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.
- public AboutDialog(JPanel parent) {
- setAlwaysOnTop(true);
- getContentPane().add(parent, BorderLayout.SOUTH);
- setDefaultCloseOperation(DISPOSE_ON_CLOSE);
- setModal(true);
- setResizable(false);
- setTitle("Editor");
- setIconImage(iPrintManager);
- pack();
- setVisible(true);
- }
The jframe:
- final JFrame d=new JFrame();
- JOptionPane.showMessageDialog(d,"Successfully modified","Alert",JOptionPane.INFORMATION_MESSAGE);
Help me to solve my issue.