Components disappear after having moved them
Hi again,
I've created a JFrame which looks like this:
[img]http://home.hccnet.nl/f.m.boekhorst/1.JPG[/img]
This is all fine until you hit the big O (maximize). Here is the code I use for the button:
if (source == maximize){
if (this.getBounds().width != (int)Toolkit.getDefaultToolkit().getScreenSize().getWidth() & this.getBounds().height != (int)Toolkit.getDefaultToolkit().getScreenSize().getHeight()){
this.setBounds(0, 0, (int)Toolkit.getDefaultToolkit().getScreenSize().getWidth(), (int)Toolkit.getDefaultToolkit().getScreenSize().getHeight());
}else{
this.setBounds(Integer.parseInt(p.getProperty("screen.x_pos")), Integer.parseInt(p.getProperty("screen.y_pos")), Integer.parseInt(p.getProperty("screen.x_bound")), Integer.parseInt(p.getProperty("screen.y_bound")));
}
maximize.setIcon(over_maximize);
updateScreen();
}
And here is the code for updateScreen:
publicvoid updateScreen(){
// Reposition the components
close.setBounds(this.getBounds().width - 23, 0, 23, 26);
maximize.setBounds(this.getBounds().width - 47, 0, 24, 26);
minimize.setBounds(this.getBounds().width - 69, 0, 22, 26);
}
When i hit the maximize button then, it properly resized, and the components are moved. I know they should be visible, but somehow they disappear. Here is a screenshot of what it looks like (i moved the X button to the edge to show you what i'm talking about.
[img]http://home.hccnet.nl/f.m.boekhorst/2.JPG[/img]
What am i doing wrong?
MANY thanks in advance!

