fix constructor
All checks were successful
flavien's git/Projet_JAVA_P2P_STRI2A/pipeline/head This commit looks good

This commit is contained in:
js 2020-04-03 13:07:05 +02:00
parent 820ddd84bb
commit 8bd0cb569f

View File

@ -11,6 +11,11 @@ import java.awt.GridLayout;
public class Parameters extends JPanel{
private JLabel label1, label2, label3, label4, label5;
private JTextField field1, field2, field3, field4;
private JButton connectButton;
private JComboBox<String> protocolSelector;
public Parameters(){
JPanel p1 = new JPanel();
p1.setLayout(new GridLayout(5, 2));
@ -18,20 +23,17 @@ public class Parameters extends JPanel{
JPanel p2 = new JPanel();
p2.setLayout(layout);
String[] elements = {"TCP", "UDP"};
JLabel label1, label2, label3, label4, label5;
JTextField field1, field2, field3, field4;
JButton connectButton;
JComboBox<String> protocolSelector = new JComboBox<>(elements);
label1 = new JLabel("Server hostname: ");
label2 = new JLabel("Server port: ");
label3 = new JLabel("Tracker hostname: ");
label4 = new JLabel("Tracker port: ");
label5 = new JLabel("Protocol: ");
field1 = new JTextField(20);
field2 = new JTextField(20);
field3 = new JTextField(20);
field4 = new JTextField(20);
connectButton = new JButton("Connect");
this.label1 = new JLabel("Server hostname: ");
this.label2 = new JLabel("Server port: ");
this.label3 = new JLabel("Tracker hostname: ");
this.label4 = new JLabel("Tracker port: ");
this.label5 = new JLabel("Protocol: ");
this.field1 = new JTextField(20);
this.field2 = new JTextField(20);
this.field3 = new JTextField(20);
this.field4 = new JTextField(20);
this.connectButton = new JButton("Connect");
protocolSelector = new JComboBox<>(elements);
p1.add(label1);
p1.add(field1);
p1.add(label2);