15 package com.neuronrobotics.sdk.ui;
17 import javax.swing.JComboBox;
18 import javax.swing.JLabel;
19 import javax.swing.JOptionPane;
20 import javax.swing.JTextField;
22 import net.miginfocom.swing.MigLayout;
24 import com.neuronrobotics.sdk.common.BowlerAbstractConnection;
25 import com.neuronrobotics.sdk.common.Log;
26 import com.neuronrobotics.sdk.network.BowlerTCPClient;
48 private JTextField
port =
new JTextField(8);
65 setLayout(
new MigLayout(
"",
70 add(
new JLabel(
"Server:"),
"cell 0 0");
90 add(
new JLabel(
"Port:"),
"cell 0 1");
91 add(
port,
"cell 1 1");
111 int thePort = Integer.parseInt(
port.getText());
113 throw new NumberFormatException();
116 Log.
info(
"Connecting on: "+address+
":"+thePort);
120 }
catch(NumberFormatException e) {
121 JOptionPane.showMessageDialog(
null,
"Invalid port given.",
"Invalid port", JOptionPane.ERROR_MESSAGE);
122 }
catch(RuntimeException e) {
124 JOptionPane.showMessageDialog(
null,
"Invalid address given.",
"Invalid address", JOptionPane.ERROR_MESSAGE);
125 }
catch (Exception e) {
127 JOptionPane.showMessageDialog(
null,
"Invalid address given.",
"Invalid address", JOptionPane.ERROR_MESSAGE);
static void info(String message)
ConnectionDialog getConnectionDialog()
ConnectionDialog connectionDialog
static ImageIcon getIcon(String path)
TCPConnectionPanel(ConnectionDialog connectionDialog)
static String defaultServer
static void setDefaultServer(String server)
static int defaultPortNum
static final long serialVersionUID
BowlerAbstractConnection getConnection()