Originally posted by Kumar BT:
create a JDialog object and add the compoenents to it and say setVisible(true).
it goes liek this.
JFrame frame =new JFrame();//or your class which extends JFrame.
JDialog dia=new JDialog(frame,false)//modeless dialog.
dia.getConetentPane().add(yourGUIPanel);
dia.setBounds(200,300);
dia.setSize(200,300);
dia.setVisible(true);
frame.setSize(600,600);
frame.setVisible(true);
This is incorrect. I am not sure if it can be done with a JFrame, but I know with a JInternalFrame it is done like:
You might try it with a JFrame and see what happens. The only problem is the .add() method that you won't have for a JFrame because you can't add a JFrame to anything. You can only setVisible(true);
The only other alternative is to add a WindowListener to the JFrame and anytime it changes focus, call toFront() on the JFrame(s) you need to be on top all the time. Kind of sloppy, but I don't know of any other way.