3 import java.awt.event.*;
5 public class hostPanel extends JPanel {
6 JTextField h_name, dns_name, port, user, pass;
9 super( new BorderLayout() );
13 "uncnsrd.mt-kisco.ny.us"
16 JPanel p = new JPanel();
17 p.setBorder( BorderFactory.createTitledBorder(
18 BorderFactory.createEtchedBorder(), "Nodes" ) );
22 p.setLayout( new BorderLayout() );
23 p.add( "Center", new JScrollPane( theList = new JList( data ) ) );
26 MouseListener mouseListener = new MouseAdapter() {
27 public void mouseClicked(MouseEvent e) {
28 String where = (String)theList.getSelectedValue();
29 if( where == null ) return;
30 dns_name.setText( where );
31 if (e.getClickCount() == 2) {
32 citadel.me.setServer( where, port.getText() );
33 citadel.me.showLoginPanel( user.getText(), pass.getText() );
37 theList.addMouseListener(mouseListener);
40 // theList.setPrototypeCellValue("1 and 1 and 1 is 3");
42 PairPanel pp = new PairPanel(3, 10);
43 pp.addLeft( new JLabel( "BBS Name:" ) );
44 pp.addRight( h_name = new JTextField( 20 ) );
45 h_name.addActionListener( new ActionListener() {
46 public void actionPerformed( ActionEvent e ) {
47 dns_name.requestFocus();
50 pp.addLeft( new JLabel( "IP Address:" ) );
51 pp.addRight( dns_name = new JTextField( 20 ) );
52 dns_name.setText( "127.0.0.1" );
53 dns_name.addActionListener( new ActionListener () {
54 public void actionPerformed( ActionEvent e ) {
58 pp.addLeft( new JLabel( "Port:" ) );
59 pp.addRight( port = new JTextField( "504" ) );
60 port.addActionListener( new ActionListener() {
61 public void actionPerformed( ActionEvent e ) {
65 pp.addLeft( new JLabel( "Username:" ) );
66 pp.addRight( user = new JTextField( 10 ) );
67 user.addActionListener( new ActionListener() {
68 public void actionPerformed( ActionEvent e ) {
72 pp.addLeft( new JLabel( "Password:" ) );
73 pp.addRight( pass = new JPasswordField( 10 ) );
74 pass.addActionListener(new ActionListener() {
75 public void actionPerformed( ActionEvent e ) {
76 citadel.me.setServer( dns_name.getText(), port.getText() );
77 citadel.me.showLoginPanel( user.getText(), pass.getText() );
83 JButton but = new JButton( "Connect" );
84 but.addActionListener(new ActionListener() {
85 public void actionPerformed( ActionEvent e ) {
86 citadel.me.setServer( dns_name.getText(), port.getText() );
87 citadel.me.showLoginPanel( user.getText(), pass.getText() );
91 JPanel pane = new JPanel();
92 pane.setBorder(BorderFactory.createEmptyBorder(30, //top
101 public void refresh() {