[dev] [dwm] Windows size changes

From: David DEMELIER <demelier.david_AT_gmail.com>
Date: Fri, 12 Nov 2010 19:58:36 +0100


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

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");

                JPanel jp_cp = new Compteur();


Kind regards,

Demelier David
Received 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