Does Swing work with Kaffe?

Neumann, Matthew C Matthew.Neumann at SW.Boeing.com
Tue Mar 14 10:55:45 PST 2000


Hey, all.
I've gotten kaffe to run a "hello world" app for me, but I'm not having any
luck getting it to work with Swing.  It looks like it's looking for some
defaults it can't find; how can I set those explictly so that this'll work?

Simple code:
ewsh08:.m/kaffe> cat HelloWorldAppSwing.java
import javax.swing.*;
class HelloWorldAppSwing {
        public static void main (String args[]) {
                JOptionPane.showMessageDialog(null,"Hello World!","hello,
world", JOptionPane.INFORMATION_MESSAGE);
        }
}

I'm on an HP-UX v10 OS, BTW.

This is the crash message I get:

ewsh08:.m/kaffe> bin/java HelloWorldAppSwing  
java.lang.IllegalMonitorStateException
        at javax.swing.UIDefaults.get(UIDefaults.java:146)
        at javax.swing.MultiUIDefaults.get(MultiUIDefaults.java:50)
        at javax.swing.UIDefaults.getIcon(UIDefaults.java:234)
        at javax.swing.UIManager.getIcon(UIManager.java:478)
        at
javax.swing.plaf.basic.BasicOptionPaneUI.getIconForType(BasicOptionPaneUI.ja
va:470)
        at
javax.swing.plaf.basic.BasicOptionPaneUI.getIcon(BasicOptionPaneUI.java:456)
        at
javax.swing.plaf.basic.BasicOptionPaneUI.addIcon(BasicOptionPaneUI.java:437)
        at
javax.swing.plaf.basic.BasicOptionPaneUI.createMessageArea(BasicOptionPaneUI
.java:274)
        at
javax.swing.plaf.basic.BasicOptionPaneUI.installComponents(BasicOptionPaneUI
.java:127)
        at
javax.swing.plaf.basic.BasicOptionPaneUI.installUI(BasicOptionPaneUI.java:95
)
        at javax.swing.JComponent.setUI(JComponent.java:258)
        at javax.swing.JOptionPane.setUI(JOptionPane.java:1296)
        at javax.swing.JOptionPane.updateUI(JOptionPane.java:1318)
        at javax.swing.JOptionPane.<init>(JOptionPane.java:1281)
        at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:630)
        at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:498)
        at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:478)
        at HelloWorldAppSwing.main(HelloWorldAppSwing.java:4)

Anyone out there know what I'm doing wrong?

-Matt Neumann


More information about the kaffe mailing list