doesn’t compile lol

This commit is contained in:
2019-10-14 09:16:06 +02:00
parent afeb28bc1e
commit 7649656e64
4 changed files with 16 additions and 7 deletions

View File

@ -1,15 +1,18 @@
package gui;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import commandSystem.ElevatorListener;
@SuppressWarnings("serial")
class FloorPanels extends JPanel {
private int nbFloors;
private JPanel[] floors;
public FloorPanels(int nbFloors) {
public FloorPanels(int nbFloors, ElevatorListener l) {
this.nbFloors = nbFloors;
floors = new JPanel[nbFloors];
this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
@ -18,8 +21,14 @@ class FloorPanels extends JPanel {
floors[i] = new JPanel();
floors[i].setLayout(new BoxLayout(floors[i], BoxLayout.LINE_AXIS));
floors[i].add(new JLabel("" + (i + 1)));
floors[i].add(new JButton(""));
floors[i].add(new JButton(""));
if (i < nbFloors - 1) {
JButton upButton = new JButton("");
floors[i].add(upButton);
}
if (i > 1) {
JButton downButton = new JButton("");
floors[i].add(downButton);
}
this.add(floors[i]);
}
}