1 package micropolisj.gui;
3 import java.awt.FlowLayout;
4 import java.awt.event.ActionEvent;
5 import java.awt.event.ActionListener;
6 import java.awt.event.KeyEvent;
7 import java.awt.event.KeyListener;
8 import java.rmi.RemoteException;
10 import javax.swing.JButton;
11 import javax.swing.JFrame;
12 import javax.swing.JTextField;
14 import micropolisj.network.ClientMicropolis;
23 textfield =
new JTextField(
"IPv4 address");
29 setLayout(
new FlowLayout());
31 textfield.addKeyListener(
new KeyListener() {
33 public void keyTyped(KeyEvent e) {
34 if(e.getKeyCode() == KeyEvent.VK_ENTER) {
40 public void keyReleased(KeyEvent e) {
44 public void keyPressed(KeyEvent e) {
45 if(e.getKeyCode() == KeyEvent.VK_ENTER) {
54 setLocationRelativeTo(null);
69 catch(RemoteException e) {