merge avec le github + j'ai mis les trucs de l'interface dans un package gui
This commit is contained in:
25
src/gui/FloorPanels.java
Normal file
25
src/gui/FloorPanels.java
Normal file
@ -0,0 +1,25 @@
|
||||
package gui;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
|
||||
class FloorPanels extends JPanel {
|
||||
private int nbFloors;
|
||||
private JPanel[] floors;
|
||||
|
||||
public FloorPanels(int nbFloors) {
|
||||
this.nbFloors = nbFloors;
|
||||
floors = new JPanel[nbFloors];
|
||||
this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
|
||||
this.add(new JLabel("Call."));
|
||||
for (int i = 0; i < nbFloors; i++) {
|
||||
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("↓"));
|
||||
this.add(floors[i]);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user