Mercurial > hg > RemoteEditor > REPSessionManager
view rep/gui/ConnectionPanel.java @ 84:54334d83194a
*** empty log message ***
author | pin |
---|---|
date | Fri, 21 Dec 2007 16:03:04 +0900 |
parents | 91a33a634fef |
children | 8dce4348966c |
line wrap: on
line source
package rep.gui; import java.awt.LayoutManager; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JPanel; import javax.swing.JTextField; import rep.ConnectionListener; public class ConnectionPanel extends JPanel implements ActionListener{ private JButton button; private JTextField textField; private String host; public ConnectionPanel(ConnectionListener connectionlistener){ button = new JButton("Connect"); textField = new JTextField("localhost"); button.setBounds(160, 5, 100, 20); textField.setBounds(5, 5, 150, 20); this.setLayout(null); this.add(textField); this.add( button); button.addActionListener(this); } public ConnectionPanel() { button = new JButton("Connect"); textField = new JTextField("localhost"); button.setBounds(160, 5, 100, 20); textField.setBounds(5, 5, 150, 20); this.setLayout(null); this.add(textField); this.add( button); button.addActionListener(this); } public void actionPerformed(ActionEvent event) { // TODO Auto-generated method stub if (event.getSource() == button) { host = textField.getText(); System.out.println("pressed!"); } } }