Hello , everybody . I meet this problem when i
test my assignment in Solaris platform :
1: the position is not set as what i want .
2: the components is black after some other program in front of it .
But , these problems have not appeared in Windows palteform . Could u tell me why . Thanks .
BTW , this is my codes to show the JDialog :
class MyDialog extends JDialog{
...
...
public void showDialog(){
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = getSize();
if (frameSize.height > screenSize.height) {
frameSize.height = screenSize.height;
}
if (frameSize.width > screenSize.width) {
frameSize.width = screenSize.width;
}
setLocation((screenSize.width - frameSize.width)/2, (screenSize.height - frameSize.height)/2);
SwingUtilities.invokeLater(new Runnable(){
public void run(){
toFront();
}
});
pack();
repaint();
setVisible(true);
}