Anyone have any java issues in which a JFrame placement is based on the screen
resolution, and it doesn't place it right. Also, packed JFrames pack to
sizes smaller than can display the contents of the frame.
Even better, has anyone solved this?
I'm running XFree86 4.x.
Blackbox WM
1024x768 resolution
24 bit color depth.
Memory serves me that the old 1.2.2 port didn't have this problem.
Code stippit:
public static void construct(Game game){
JFrame frame=new JFrame("Game Options");
frame.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
frame.getContentPane().add(new Opanel(game,frame));
frame.pack();
frame.setResizable(false);
Dimension screenSize=
Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize=frame.getSize();
int x=(int)(screenSize.width-frameSize.width)/2;
if(x<0)x=0;
int y=(int)(screenSize.height-frameSize.height)/2;
if(y<0)y=0;
frame.setLocation(x,y);
frame.show();
}