[kaffe] Swing not working - JFrame never shown

Lennon Cook maguswizardo at gmail.com
Thu May 11 17:22:01 PDT 2006


I have been playing around with Swing, but kaffe appears to not want
me doing this. I have the following test code:

import javax.swing.*;
import java.awt.*;

public class SwingTest extends JFrame{
        public SwingTest(){
                super();

                this.getContentPane().setLayout(new GridLayout(2,2));
                this.getContentPane().add(new JButton("HELLO"));
                this.getContentPane().add(new JTextField());
                this.getContentPane().add(new JLabel("BOO"));
                this.getContentPane().add(new JButton("HELLO"));
                this.setSize(200, 200);
        }

        public static void main(String[] args){
                SwingTest sw = new SwingTest();
                System.out.println(sw.isVisible());
                sw.setVisible(true);
                System.out.println(sw.isVisible());
        }
}

Running this in an xterm works as expected - it opens, and goes into
an infinite loop. Except that the JFrame never actually becomes
visible. The output shows that it is initially invisible (prints
'false' for sw.isVisible()), but then it appears to never go past this
point. The window never shows, and it never prints true .
What would be causing this? I'm running kaffe-1.4.2 and jikes 1.22 on
FreeBSD 6.1-BETA4 .


--
Lennon Victor Cook
"He who receives an idea from me receives without lessening, as he who
lights his candle at mine receives light without darkening" - Thomas
Jefferson


-- 
Lennon Victor Cook
"He who receives an idea from me receives without lessening, as he who
lights his candle at mine receives light without darkening" - Thomas
Jefferson




More information about the kaffe mailing list