Source code: evt/gui/JspmEvtServerDialog.java
1 /*-----------------------------------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (C) */
4 /* */
5 /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU */
6 /* General Public License as published by the Free Software Foundation; either version 2 of the */
7 /* License, or (at your option) any later version. */
8 /* */
9 /* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; */
10 /* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR */
11 /* PURPOSE. See the GNU General Public License for more details. */
12 /* */
13 /* You should have received a copy of the GNU General Public License along with this program; if */
14 /* not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA */
15 /* 02111-1307 USA */
16 /* */
17 /*-----------------------------------------------------------------------------------------------------*/
18 /* */
19 /* $Author: strand01 $ $Revision: 1.3 $ $Date: 2001/12/20 14:23:03 $ */
20 /* */
21 /*-----------------------------------------------------------------------------------------------------*/
22
23 package evt.gui;
24
25 // Java Classes
26 import java.awt.*;
27 import java.awt.event.*;
28 import java.io.*;
29 import java.util.*;
30
31 // Swing Classes
32 import javax.swing.*;
33 import javax.swing.table.*;
34
35 // JSPM classes
36 import com.jdk.*;
37
38 /**
39 * This class provides the login dialog.
40 *
41 * @author Steve Randall (strand012001@yahoo.com)
42 * @version 0.0.8
43 * @date 31/10/2001
44 */
45 public class JspmEvtServerDialog extends JDialog
46 {
47 /*
48 * The buttonPanel
49 */
50 private JPanel buttonPanel = null;
51
52 /*
53 * Result flag, true if OK was pressed otherwise false
54 */
55 private boolean result = false;
56
57 public JspmEvtServerDialog(Vector server)
58 {
59 super();
60
61 setTitle("Select Jspm Event Management Server");
62
63 getContentPane().setLayout(new BorderLayout());
64
65 buttonPanel = createButtonPanel();
66
67 getContentPane().add(buttonPanel, BorderLayout.SOUTH);
68
69 pack();
70 show();
71 }
72
73 private JPanel createButtonPanel()
74 {
75 JButton okButton, cancelButton, helpButton;
76
77 buttonPanel = new JPanel();
78
79 okButton = new JButton(" OK ");
80 okButton.addActionListener(new ActionListener() {
81 public void actionPerformed(ActionEvent e) {
82 result = true;
83 dispose();
84 }
85 });
86
87 cancelButton = new JButton("Cancel");
88 cancelButton.addActionListener(new ActionListener() {
89 public void actionPerformed(ActionEvent e)
90 {
91 result = false;
92 dispose();
93 }
94 });
95
96 helpButton = new JButton(" Help ");
97 helpButton.addActionListener(new ActionListener() {
98 public void actionPerformed(ActionEvent e) {
99 try
100 {
101 JspmBrowserLauncher.openURL("file://"+JspmEvtConstants.HELP_DIR+"/console.html");
102 } catch (IOException ex) {
103 }
104 }
105 });
106
107 buttonPanel = new JPanel(false);
108 buttonPanel.setLayout(new FlowLayout());
109 buttonPanel.setBorder(BorderFactory.createLoweredBevelBorder());
110
111 buttonPanel.add(okButton);
112 buttonPanel.add(cancelButton);
113 buttonPanel.add(helpButton);
114
115 return buttonPanel;
116 }
117 };
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146