blob: 37d80bda53b12d3bdbb8bdc3c83a0319b8947c9b [file] [log] [blame]
danielpb913fa72013-03-03 06:23:20 +00001/**
2 *
3 */
4package org.spartanrobotics;
5
6import javax.swing.JOptionPane;
7
8/**
9 * @author daniel
10 *
11 */
12
13import com.googlecode.javacv.CanvasFrame;
14
15/** Allows other classes to display message boxes bound to main window. */
16public class Messages {
17
18 private static CanvasFrame main;
19
20 /** Constructor
21 *
22 * @param main is the window your messages will be associated with.
23 */
24 public static void SetWindow(CanvasFrame main) {
25 Messages.main = main;
26 }
27 /** Shows a warning message. */
28 public static void warning(String message) {
29 JOptionPane.showMessageDialog(main, message, "Warning:", JOptionPane.WARNING_MESSAGE);
30 }
31
32 /** Shows a severe error message. */
33 public static void severe(String message) {
34 JOptionPane.showMessageDialog(main, message, "Severe:", JOptionPane.ERROR_MESSAGE);
35 }
36
37 /** Shows an info message. */
38 public static void info(String message) {
39 JOptionPane.showMessageDialog(main, message);
40 }
41}