#107 Fix IndexOutOfBoundException in look and feel selection

open
5
2008-08-20
2008-08-20
Robert Munteanu
No

On linux the look and feel selection works erratically, and I'm unable to select the 'GTK+' LAF. It seems to be that the dialog includes 6 LAF names, but does not check if they are installed ( i.e. the windows LAF is not available on Linux ) and also adds the available ones. The patch simplifies by only adding the available looks and feels.

The stack trace is below and the patch is attached. The patch is more of a suggestion since I'm unable to build the project ( generate then add jars then add ant tasks ... ) . Perhaps a dev guide would be nice. But I digress.

STDERR: Exception occurred during event dispatching:
STDERR: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 8
STDERR: at java.util.Vector.get(Vector.java:694)
STDERR: at freemind.common.ComboProperty.getValue(ComboProperty.java:134)
STDERR: at freemind.preferences.layout.OptionPanel.getOptionProperties(OptionPanel.java:163)
STDERR: at freemind.preferences.layout.OptionPanel.access$100(OptionPanel.java:88)
STDERR: at freemind.preferences.layout.OptionPanel$2.actionPerformed(OptionPanel.java:228)
STDERR: at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
STDERR: at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
STDERR: at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
STDERR: at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
STDERR: at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
STDERR: at java.awt.Component.processMouseEvent(Component.java:6041)
STDERR: at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
STDERR: at java.awt.Component.processEvent(Component.java:5806)
STDERR: at java.awt.Container.processEvent(Container.java:2058)
STDERR: at java.awt.Component.dispatchEventImpl(Component.java:4413)
STDERR: at java.awt.Container.dispatchEventImpl(Container.java:2116)
STDERR: at java.awt.Component.dispatchEvent(Component.java:4243)
STDERR: at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
STDERR: at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
STDERR: at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
STDERR: at java.awt.Container.dispatchEventImpl(Container.java:2102)
STDERR: at java.awt.Window.dispatchEventImpl(Window.java:2440)
STDERR: at java.awt.Component.dispatchEvent(Component.java:4243)
STDERR: at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
STDERR: at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
STDERR: at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
STDERR: at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:177)
STDERR: at java.awt.Dialog$1.run(Dialog.java:1045)
STDERR: at java.awt.Dialog$3.run(Dialog.java:1097)
STDERR: at java.security.AccessController.doPrivileged(Native Method)
STDERR: at java.awt.Dialog.show(Dialog.java:1095)
STDERR: at java.awt.Component.show(Component.java:1422)
STDERR: at java.awt.Component.setVisible(Component.java:1375)
STDERR: at java.awt.Window.setVisible(Window.java:806)
STDERR: at java.awt.Dialog.setVisible(Dialog.java:985)
STDERR: at freemind.controller.Controller$PropertyAction.actionPerformed(Controller.java:1480)
STDERR: at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
STDERR: at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
STDERR: at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
STDERR: at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
STDERR: at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
STDERR: at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1220)
STDERR: at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1261)
STDERR: at java.awt.Component.processMouseEvent(Component.java:6041)
STDERR: at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
STDERR: at java.awt.Component.processEvent(Component.java:5806)
STDERR: at java.awt.Container.processEvent(Container.java:2058)
STDERR: at java.awt.Component.dispatchEventImpl(Component.java:4413)
STDERR: at java.awt.Container.dispatchEventImpl(Container.java:2116)
STDERR: at java.awt.Component.dispatchEvent(Component.java:4243)
STDERR: at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
STDERR: at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
STDERR: at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
STDERR: at java.awt.Container.dispatchEventImpl(Container.java:2102)
STDERR: at java.awt.Window.dispatchEventImpl(Window.java:2440)
STDERR: at java.awt.Component.dispatchEvent(Component.java:4243)
STDERR: at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
STDERR: at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
STDERR: at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
STDERR: at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
STDERR: at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
STDERR: at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
STDERR: at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

Discussion

  • LookAndFeel patch

     
    Attachments