My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions

Issue 1 attachment: WindoText.java.patch (2.2 KB)

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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
--- trunk/src/view/WindoText.java
+++ trunk/src/view/WindoText.java
@@ -9,16 +9,16 @@
import javax.swing.JPanel;
import java.awt.FlowLayout;

+// La norme des accolades, c'est en bout de ligne
public class WindoText extends JFrame

{
- private JPanel panel;
- private static JLabel label;
+ private JPanel panel;
+ private static JLabel label; // Pourquoi static ???
private ClockDisplay clock; // c'est qui ClockDisplay ? tu as peut être oublié de comit une classe

-
-
public WindoText(ClockDisplay clock) // what ? un truc public sans type ?
+ // Rhoooo Patoche !!! C'est un constructeur !!!!
{
super();
this.clock=clock;
@@ -29,6 +29,10 @@
tu appreciera de comprendre ce que fait chaque fonctions sans lire tout le code.
La entre makeWindow et buildWindow je suis pas sur de faire la différence à l'oeil nul*/

+ // J'suis d'accord
+ // Une seule méthode, même un peu longue
+ // ou alors tu nommes bien et tu sépares les responsabilités
+
public void makeWindow()
{
this.panel=new JPanel();
@@ -38,7 +42,7 @@
this.buildClock();
}

- private void buildWindow()
+ private void buildWindow() // celle la OK
{
this.setTitle("Horloge");
this.setSize(320,240);
@@ -50,16 +54,24 @@

private void buildContentPane()
{
- panel.setLayout(new FlowLayout());
+ panel.setLayout(new FlowLayout()); // Utilise "null" pour commencer
+
+
+ // label.setLocation(...
+ // label.setSize(...
panel.add(label);
this.getContentPane().add(panel);
}

private void buildClock()
{
- panel.setLayout(new FlowLayout());
- JLabel l=new JLabel(this.clock.getTime());
+ panel.setLayout(new FlowLayout()); // déja fait dans buildContentPane
+ JLabel l=new JLabel(this.clock.getTime());
+
+ // l.setLocation(...
+ // l.setSize(...
+
panel.add(l);
- this.getContentPane().add(this.panel);
+ this.getContentPane().add(this.panel); // déjà fait dans buildContentPane
}
}
Powered by Google Project Hosting