aboutsummaryrefslogtreecommitdiff
path: root/src/AlertBox.java
blob: 14f20fc95fbd9ad4a6d2e6bc135f5467d91a5419 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*    */ import java.awt.BorderLayout;
/*    */ import java.awt.Toolkit;
/*    */ import java.awt.event.ActionEvent;
/*    */ import java.awt.event.ActionListener;
/*    */ import javax.swing.JButton;
/*    */ import javax.swing.JFrame;
/*    */ import javax.swing.JLabel;
/*    */ import javax.swing.JPanel;
/*    */ 
/*    */ public class AlertBox extends JFrame
/*    */   implements ActionListener
/*    */ {
/*    */   private JPanel bottom;
/*    */   private JPanel top;
/*    */   private JButton ok;
/*    */ 
/*    */   public AlertBox(String message, String title)
/*    */   {
/* 19 */     setTitle(title);
/* 20 */     setLayout(new BorderLayout());
/* 21 */     this.bottom = new JPanel();
/* 22 */     this.top = new JPanel();
/* 23 */     add(this.top, "North");
/* 24 */     add(this.bottom, "South");
/* 25 */     this.top.add(new JLabel(message));
/* 26 */     this.ok = new JButton("OK");
/* 27 */     this.bottom.add(this.ok);
/* 28 */     this.ok.addActionListener(this);
/* 29 */     setVisible(true);
/* 30 */     setIconImage(Toolkit.getDefaultToolkit().getImage("modulus_symbol.png"));
/* 31 */     pack();
/*    */   }
/* 33 */   public void actionPerformed(ActionEvent e) { setVisible(false); } 
/* 34 */   public static void throwError(String alert) { new AlertBox(alert, "Error"); }
/*    */ 
/*    */ }

/* Location:           Modulus.jar
 * Qualified Name:     AlertBox
 * JD-Core Version:    0.6.2
 */