diff options
| author | njames <njames@us.ibm.com> | 2015-03-02 05:54:20 +0800 |
|---|---|---|
| committer | njames <njames@us.ibm.com> | 2015-03-02 05:54:20 +0800 |
| commit | ab1b14c1ca6f7c9878dcc591cff528753f8b11c9 (patch) | |
| tree | d25ddaf7966bb187bff2b83b9f01f64aed22ebfc /src/com | |
| parent | 7753bf39ba79d2defc86cf302f9f6c478305afda (diff) | |
| download | serverwiz-ab1b14c1ca6f7c9878dcc591cff528753f8b11c9.tar.gz serverwiz-ab1b14c1ca6f7c9878dcc591cff528753f8b11c9.zip | |
Popup window to show console during startup
Diffstat (limited to 'src/com')
| -rw-r--r-- | src/com/ibm/ServerWizard2/MessagePopup.java | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/com/ibm/ServerWizard2/MessagePopup.java b/src/com/ibm/ServerWizard2/MessagePopup.java new file mode 100644 index 0000000..4d7057e --- /dev/null +++ b/src/com/ibm/ServerWizard2/MessagePopup.java @@ -0,0 +1,60 @@ +package com.ibm.ServerWizard2; + +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JTextArea; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; + +public class MessagePopup implements ActionListener { + + public MessagePopup() { + // TODO Auto-generated constructor stub + } + + //private final int ONE_SECOND = 1000; + + //private Timer timer; + private JFrame frame; + private JLabel msgLabel; + public JTextArea text; + + public MessagePopup(String str, int seconds) { + frame = new JFrame("Test Message"); + msgLabel = new JLabel(str, SwingConstants.CENTER); + text = new JTextArea(30,60); + + 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(text, 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(); + } +} |

