blob: 6bfef887dccc1498642e60eef67a1abf67a853e5 (
plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
package com.ibm.ServerWizard2.view;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
public class MessagePopup implements ActionListener {
public MessagePopup() {
}
//private final int ONE_SECOND = 1000;
//private Timer timer;
private JFrame frame;
//private JLabel msgLabel;
public JTextArea text;
private JScrollPane sp;
public MessagePopup(String str, int seconds) {
frame = new JFrame("ServerWiz2 Launcher Console");
//msgLabel = new JLabel(str, SwingConstants.CENTER);
text = new JTextArea(10,80);
sp = new JScrollPane(text);
//msgLabel.setPreferredSize(new Dimension(600, 400));
//timer = new Timer(this.ONE_SECOND * seconds, this);
// only need to fire up once to make the message box disappear
//timer.setRepeats(false);
}
/**
* Start the timer
*/
public void open() {
// make the message box appear and start the timer
//frame.getContentPane().add(msgLabel, BorderLayout.CENTER);
frame.getContentPane().add(sp, BorderLayout.CENTER);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
//timer.start();
}
public void close() {
frame.dispose();
}
/**
* Handling the event fired by the timer
*/
public void actionPerformed(ActionEvent event) {
// stop the timer and kill the message box
//timer.stop();
//frame.dispose();
}
}
|