how to prevent JDialog from going behind the screen while switching tabs?
I have a JTabbedPane with two tabs. A JInternalframe is brought up from one of the tabs. This JInternalframe has a pop up dialog which is modal to the JInternalframe, but non modal to the tabs i.e. it allows switching between the tabs.
But when I switch between the tabs, the pop up is going behind the JInternalframe alternatively on linux OS. But this works fine on windows OS. Is there any solution for this?
On hierarchy change, this is the code I have added.
public void hierarchyChanged(HierarchyEvent e) {
super.hierarchyChanged(e);
System.out.println("hierarchyChanged:"+this);
if (e.getComponent().isShowing()) {
System.out.println("showing");
setExtendedState(NORMAL);
setLocationRelativeTo(comp);
setAlwaysOnTop(true);
toFront();
setVisible(true);
}else {
System.out.println("not showing");
setVisible(false);
}
}
If anyone has any idea about this problem, pls do reply.
Message was edited by:
SSVN
Message was edited by:
SSVN

