Dinesh Santhalingam

Dinesh Santhalingam

  • NA
  • 737
  • 368.7k

How to set the J frame into front?

Apr 21 2017 12:14 AM
I am using JDialog swing component to develop a gui.I have a button in my Jdialog.
I set the JDialog setAlwaysontop is true.When user clicks a button then a messagebox will shown.Here what my problem is ,Jdialog is open but when i click the button the messagebox wont displaying.But it runs in background.
 
 
 
  1. public AboutDialog(JPanel parent) {    
  2.         setAlwaysOnTop(true);    
  3.         getContentPane().add(parent, BorderLayout.SOUTH);    
  4.         setDefaultCloseOperation(DISPOSE_ON_CLOSE);    
  5.         setModal(true);    
  6.         setResizable(false);    
  7.         setTitle("Editor");    
  8.         setIconImage(iPrintManager);    
  9.         pack();    
  10.         setVisible(true);    
  11.     }    
 The jframe:
  1. final JFrame d=new JFrame();  
  2. JOptionPane.showMessageDialog(d,"Successfully modified","Alert",JOptionPane.INFORMATION_MESSAGE);      
 
Help me to solve my issue.