tags:

views:

24

answers:

1

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

A: 

dialog.setAlwaysOnTop(true);

thelost