Blank window for the application ( after upgrading to java 1.6 )
Hi,
After launching /connecting to the application shows a blank window however it worked fine with java 1.5. I think few methods have been deprecated and guess it should be something to do with repaint, refresh, setvisibility.
The screen shows up after clicking on some other icons on the same screen.
I have pasted below part of the code...
public void showWindow() {
if (ready) {
// set window locations
if (parent != null) {
expertFrame.setLocation(parent.getLocation());
if (allowWizard) {
wizardFrame.setLocation(parent.getLocation());
}
} else {
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
Rectangle rect = expertFrame.getBounds();
expertFrame.setLocation((screen.width - rect.width)/2, (screen.height - rect.height)/2);
if (allowWizard) {
wizardFrame.setLocation((screen.width - rect.width)/2, (screen.height - rect.height)/2);
}
}
// show window according to mode
if (!allowWizard) {
if (wizardFrame != null && topPanelWizard != null) {
wizardFrame.getContentPane().remove(topPanelWizard );
}
expertFrame.getContentPane().add(topPanelExpert, BorderLayout.NORTH);
topPanelExpert.repaint();
expertFrame.repaint();
expertFrame.setVisible(true);
} else {
if (wizardStartup) {
wizard = true;
wizardPanel.refreshScreen();
wizardFrame.getContentPane().add(topPanelWizard, BorderLayout.NORTH);
topPanelWizard.repaint();
expertFrame.setVisible(false);
wizardFrame.setVisible(true);
} else {
wizard = false;
expertPanel.refreshScreen();
wizardFrame.getContentPane().remove(topPanelWizard );
expertFrame.getContentPane().add(topPanelExpert, BorderLayout.NORTH);
topPanelExpert.repaint();
wizardFrame.repaint();
expertFrame.setVisible(true);
wizardFrame.setVisible(false);
}
}
}
Re: Blank window for the application ( after upgrading to java 1.6 )
Can you make a small simple program (SSCCE) that compiles, executes and shows the problem for testing.
Hard to do that with code segments.
Please wrap the code in code tags to preserve its formatting