fix stage ordering
This commit is contained in:
parent
b820f041ae
commit
771d76da3f
@ -13,7 +13,7 @@ class ElevatorPanel extends JPanel {
|
|||||||
this.add(new JLabel("Elevator panel."));
|
this.add(new JLabel("Elevator panel."));
|
||||||
|
|
||||||
buttons = new JButton[nbFloors];
|
buttons = new JButton[nbFloors];
|
||||||
for (int i = 0; i < nbFloors; i++) {
|
for (int i = nbFloors-1; i >= 0; i--) {
|
||||||
buttons[i] = new JButton("" + i);
|
buttons[i] = new JButton("" + i);
|
||||||
this.add(buttons[i]);
|
this.add(buttons[i]);
|
||||||
}
|
}
|
||||||
|
@ -17,15 +17,15 @@ class FloorPanels extends JPanel {
|
|||||||
floors = new JPanel[nbFloors];
|
floors = new JPanel[nbFloors];
|
||||||
this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
|
this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
|
||||||
this.add(new JLabel("Call."));
|
this.add(new JLabel("Call."));
|
||||||
for (int i = 0; i < nbFloors; i++) {
|
for (int i = nbFloors-1; i >= 0; i--) {
|
||||||
floors[i] = new JPanel();
|
floors[i] = new JPanel();
|
||||||
floors[i].setLayout(new BoxLayout(floors[i], BoxLayout.LINE_AXIS));
|
floors[i].setLayout(new BoxLayout(floors[i], BoxLayout.LINE_AXIS));
|
||||||
floors[i].add(new JLabel("" + (i + 1)));
|
floors[i].add(new JLabel("" + i));
|
||||||
if (i < nbFloors - 1) {
|
if (i < nbFloors - 1) {
|
||||||
JButton upButton = new JButton("↑");
|
JButton upButton = new JButton("↑");
|
||||||
floors[i].add(upButton);
|
floors[i].add(upButton);
|
||||||
}
|
}
|
||||||
if (i > 1) {
|
if (i > 0) {
|
||||||
JButton downButton = new JButton("↓");
|
JButton downButton = new JButton("↓");
|
||||||
floors[i].add(downButton);
|
floors[i].add(downButton);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user