1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
public class Panel_taches extends JPanel {
private List drawables = new LinkedList();
private IDrawable rect, rect2, rect3, rect4;
public Panel_taches() {
super();
this.setSize(new Dimension(500, 1000));
rect = new RectangleDrawable(Color.BLUE,new Point(10,10),new Dimension(50,250));
rect2 = new RectangleDrawable(Color.BLUE,new Point(270,10),new Dimension(50,50));
rect3 = new RectangleDrawable(Color.BLUE,new Point(330,10),new Dimension(50,100));
rect4 = new RectangleDrawable(Color.BLUE,new Point(440,10),new Dimension(50,80));
this.addDrawable(rect);
this.addDrawable(rect2);
this.addDrawable(rect3);
this.addDrawable(rect4);
this.setLayout(new GridBagLayout());
JLabel label1 = new JLabel("Tâche 1 (25 min)");
label1.setBackground(Color.WHITE);
GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
c.insets = new Insets(100, 100, 0, 0);
c.anchor = GridBagConstraints.LINE_START;
this.add(label1, c);
}
} |
Partager