How to display a window on top with Java ?

Posted by Frank on Stack Overflow See other posts from Stack Overflow or by Frank
Published on 2010-05-06T17:32:56Z Indexed on 2010/05/06 17:38 UTC
Read the original article Hit count: 245

Filed under:
|
|

I have the following code to display a message :

JLabel A_Label=new JLabel("Updating channels ...");
A_Label.setFont(new Font("Times New Roman",0,16));
A_Label.setForeground(Color.BLUE);
A_Label.setHorizontalAlignment(SwingConstants.CENTER);
JOptionPane pane=new JOptionPane(A_Label);
Object[] options=new String[]{"OK"};
pane.setOptions(options);
JDialog dialog=pane.createDialog(new JFrame(),"Updating Channels");
dialog.setModal(false);
dialog.setVisible(true);

When the program runs, other windows displayed on top of it, how can I make it the top window ? I wonder if I can call "pane" or "dialog" to be on top ?

Frank

© Stack Overflow or respective owner

Related posts about top

Related posts about window