On Fri, Nov 12, 2010 at 7:58 PM, David DEMELIER <demelier.da...@gmail.com> wrote: > 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 David > >
When I had problems with Java some years ago I remember to setup the environment variable= Mtoolkit and worked (with a very old version of dwm)