1 package com.instantbank.common.uiutils;
2
3 import javax.swing.JFrame;
4 import javax.swing.JTextArea;
5 import javax.swing.JScrollPane;
6
7
15 public class MessageFrame extends JFrame {
16
17
20 private JTextArea area = new JTextArea(10, 20);
21
22
25 private JScrollPane js;
26
27
30 private static MessageFrame msgFr = null;
31
32
33
36 private MessageFrame() {
37 js = new JScrollPane(area);
38 this.getContentPane().add(js);
39 this.setTitle("Debug Frame");
40 this.setSize(300, 200);
41 this.setVisible(true);
42 }
43
44
45
50 public static MessageFrame getFrame() {
51 if(msgFr == null) {
52 msgFr = new MessageFrame();
53 }
54 return msgFr;
55 }
56
57
58
63 public void addText(String s) {
64 area.append(s + "\n");
65 }
66 }
67