Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package sqe.elevator.gruppeD.gui;
- import javax.swing.JDialog;
- import javax.swing.JFrame;
- import javax.swing.JOptionPane;
- import javax.swing.WindowConstants;
- public class ExceptionDialog {
- public static void displayErrorMsg(String errorMsg) {
- JOptionPane pane = new JOptionPane(errorMsg,JOptionPane.ERROR_MESSAGE, JOptionPane.DEFAULT_OPTION, null, new Object[]{}, null);
- JDialog dialog = pane.createDialog(null, "ECC Error Handling");
- dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- dialog.setVisible(true);
- /*
- * Alternative, falls dudoch ein Button haben willst und eine Action beim Klick durchführen willst
- JOptionPane pane = new JOptionPane(errorMsg,JOptionPane.ERROR_MESSAGE, JOptionPane.DEFAULT_OPTION, null, new Object[]{}, null);
- int res=pane.showConfirmDialog(pane, errorMsg);
- if(res==JOptionPane.OK_OPTION)
- {
- pane.showConfirmDialog(pane, "lkajsdlkasjd");
- }
- */
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment