JFrame.setResizable(false) brings unexpected behaviour in j2sdk 8
niagarasoft20-macosxportdev at yahoo.com
niagarasoft20-macosxportdev at yahoo.com
Mon Jan 20 18:22:47 PST 2014
Hello , I've come across something I've never had an issue with until Java 8. The code below results in the JFrame zooming from the normally placed screen position (upper left hand corner) down to the lower left hand corner position. If I call the setResizable(false) method after the JFrame is visible then there is no problem. What is going on? See the same code below:
============ JFramePositionTest.java =======================
import javax.swing.*;
import java.awt.*;
public class JFramePositionTest {
public static void main (String args[]){
new JFramePositionTest();
}
public JFramePositionTest(){
JFrame aFrame = new JFrame();
aFrame.setSize(300,300);
aFrame.setResizable(false);
aFrame.setVisible(true);
//aFrame.setResizable(false); //COMMENT ABOVE setResizable(false) method and CALL THE CODE HERE THEN THERE'S NO PROBLEM
aFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
}
More information about the macosx-port-dev
mailing list