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