JmeDesktop - ColorChooser


I was running some tests with a colorChooser dialog, fired from a button as per usual.

Shows up and works fine in windowed mode, but in fullscreen the dialog appears to be hidden, and alt tabbing does nothing…whole system seems locked out.

It seems like the dialog has focus however, as while Alt Tabbing does not bring anything else into focus I have to use the tab key twice and then enter to hit the hidden cancel button on the mysteriously hidden colorchooser dialog to get my app back to normal…which also seems to have screwed up some of the rendering pipeline.

Strange behaviour.

Any clues?

Do I need to set this up like the TestJmeDesktop.showDialog()?

If so I'm not sure how as the colorchoosher has different creation code than this example : ie; it is a dialog by default.

Any clues appreciated.

relevant action code from my colorchooser class

    public void actionPerformed(ActionEvent e) {
        JColorChooser colorChooser = BasicComponentFactory.createColorChooser(bufferedColorModel);
        //needed for use with jmedesktop
        ActionListener okHandler = new OKHandler(trigger);
        JDialog dialog = JColorChooser.createDialog(parent, "Choose Color", true, colorChooser, okHandler, null);
        dialog.addWindowListener(new Closer());
        dialog.addComponentListener(new DisposeOnClose());
        dialog.setVisible(true); // blocks until user brings dialog down...


sonicviz said:

Do I need to set this up like the TestJmeDesktop.showDialog()?


ColorChooser can be inserted into an internal frame, too. But I doubt it will work in JMEDesktop as it might use heavy weight components on some platforms - you can still try though (simply call new JColorChooser() and insert it into some panel/frame). The safe way is to build an own chooser (probably not that complex).

Thanks Irrisor.

It appears the problem was the JDialog.

JColorChooser works fine by itself and handling the update myself.