Also posted on coderanch.com.
import javax.swing.*;
public class Tmp {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
JFrame frame = new JFrame();
frame.setSize(200, 200);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(new JTextField());
frame.setVisible(true);
}
});
}
}
A problem regarding resizing this JFrame.
This is how it looks by default right after program starts:
When I try to resize it like shown on a picture and move a mouse pointer to the top of a screen (like on picture below) I see this:
When I release the mouse the frame is resized but unresponsive. And there is a black space on it. This is how it looks:
This happens on Windows 8.1 and java 1.7.0_45 (it also happens on Windows 7).
The problem does not occur when using other ways of resizing a frame in Windows.
It only happens when "Show window contents while dragging" is active in system settings.
Why is it happening?
How can this be fixed?
frame.setVisible(true);
toframe.pack(); frame.setVisible(true);
.. – Stribling