Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. JOptionPane.showMessageDialog(null, Interface, caption, JOptionPane.WARNING_MESSAGE, icon);
  2.  
  3. public void actionPerformed(ActionEvent e) {
  4. // assuming this is being called from within a JFrame named myFrame
  5. JDialog dialog = new JDialog(myFrame, "Dialog Title", ModalityType.APPLICATION_MODAL);
  6. dialog.getContentPane().add(interface);
  7. dialog.pack();
  8. dialog.setLocationRelativeTo(myFrame);
  9. dialog.setVisible(true);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement