Hello,
I was surprised to see that a java window does not update its content,
in fact nothing changes. If you resize the window nothing happens and
the usual behavior is that the window updates its content to the new
size.
On pekwm or gnome, it works. The window `stretch' its content to the
maximal size, on dwm nothing happens it stays at white.
You can try my little example program on a free wm and dwm :
import javax.swing.*;
import java.awt.*;
public class Compteur extends JPanel {
JButton jp_plus; /* Bouton plus */
JButton jp_minus; /* Bouton moins */
JTextField jtf_field; /* Affichage du compteur */
public Compteur() {
super ();
this.setLayout(new BorderLayout());
jp_plus = new JButton("+");
jp_minus = new JButton("-");
jtf_field = new JTextField("0", 20);
this.add(jp_plus, BorderLayout.WEST);
this.add(jtf_field, BorderLayout.CENTER);
this.add(jp_minus, BorderLayout.EAST);
}
public static void main(String[] args) {
JFrame jf = new JFrame("Exercice 2 : Compteur");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jf.setSize(400,100);
JPanel jp_cp = new Compteur();
jf.add(jp_cp);
jf.setVisible(true);
}
}
Kind regards,
-- Demelier DavidReceived on Fri Nov 12 2010 - 19:58:36 CET
This archive was generated by hypermail 2.2.0 : Fri Nov 12 2010 - 20:00:04 CET