1 34 package net.myvietnam.mvncore.gui; 35 36 import java.awt.Component ; 37 import javax.swing.JOptionPane ; 38 39 public final class MessageBox { 40 41 private MessageBox() { 42 } 43 44 public static void showErrorBox(Component parentComponent, Object message) { 45 JOptionPane.showMessageDialog(parentComponent, message, "Error", JOptionPane.ERROR_MESSAGE); 46 } 47 48 public static void showInfoBox(Component parentComponent, Object message) { 49 JOptionPane.showMessageDialog(parentComponent, message, "Information", JOptionPane.INFORMATION_MESSAGE); 50 } 51 52 public static void showWarningBox(Component parentComponent, Object message) { 53 JOptionPane.showMessageDialog(parentComponent, message, "Warning", JOptionPane.WARNING_MESSAGE); 54 } 55 56 public static void showQuestionBox(Component parentComponent, Object message) { 57 JOptionPane.showMessageDialog(parentComponent, message, "Question", JOptionPane.QUESTION_MESSAGE); 58 } 59 } 60 | Popular Tags |