Exception when changing L&F during runtime

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Exception when changing L&F during runtime

Postby safesoft » Wed Jan 11, 2012 8:14 pm

When I change L&F of my application during runtime, I got the following exception;

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.jidesoft.plaf.basic.BasicJideTabbedPaneUI.rotateInsets(Unknown Source)
at com.jidesoft.plaf.basic.BasicJideTabbedPaneUI.getTabAreaInsets(Unknown Source)
at com.jidesoft.plaf.basic.BasicJideTabbedPaneUI$TabbedPaneLayout.calculateSize(Unknown Source)
at com.jidesoft.plaf.basic.BasicJideTabbedPaneUI$TabbedPaneLayout.minimumLayoutSize(Unknown Source)
at java.awt.Container.minimumSize(Container.java:1651)
at java.awt.Container.getMinimumSize(Container.java:1636)
at javax.swing.JComponent.getMinimumSize(JComponent.java:1716)
at javax.swing.plaf.basic.BasicSplitPaneUI$BasicHorizontalLayoutManager.getMinimumSizeOfComponent(BasicSplitPaneUI.java:1621)
at javax.swing.plaf.basic.BasicSplitPaneUI$BasicHorizontalLayoutManager.distributeSpace(BasicSplitPaneUI.java:1943)
at javax.swing.plaf.basic.BasicSplitPaneUI$BasicHorizontalLayoutManager.layoutContainer(BasicSplitPaneUI.java:1328)
at java.awt.Container.layout(Container.java:1421)
at java.awt.Container.doLayout(Container.java:1410)
at java.awt.Container.validateTree(Container.java:1507)
at java.awt.Container.validateTree(Container.java:1513)
at java.awt.Container.validateTree(Container.java:1513)
at java.awt.Container.validateTree(Container.java:1513)
at java.awt.Container.validate(Container.java:1480)
at javax.swing.RepaintManager.validateInvalidComponents(RepaintManager.java:669)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:124)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

It messes up the whole GUI and freezes the application.

This is what I call to update GUI

javax.swing.UIManager.setLookAndFeel(com.sun.java.swing.plaf.windows.WindowsLookAndFeel);
SwingUtilities.updateComponentTreeUI(this);
LookAndFeelFactory.installJideExtension();

we are using version : 2.2.0
safesoft
 
Posts: 8
Joined: Thu Apr 01, 2010 5:19 pm

Re: Exception when changing L&F during runtime

Postby JIDE Support » Wed Jan 11, 2012 8:38 pm

Did you invoke those code in EventDispatcherThread?

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36466
Joined: Sun Sep 14, 2003 10:49 am

Re: Exception when changing L&F during runtime

Postby safesoft » Thu Jan 12, 2012 12:03 pm

yes.
safesoft
 
Posts: 8
Joined: Thu Apr 01, 2010 5:19 pm

Re: Exception when changing L&F during runtime

Postby JIDE Support » Thu Jan 12, 2012 12:46 pm

Can you please give the latest JIDE release a try then? 2.2.0 is a quite old version, which was generated 4 years ago. Please also check if you have any thread other than EventDispatcherThread that is trying to update UI.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36466
Joined: Sun Sep 14, 2003 10:49 am

Re: Exception when changing L&F during runtime

Postby safesoft » Thu Jan 12, 2012 1:41 pm

Thank you for the information. I update my jide version to 2.9.7. I can change L&F during run-time and there is no errors. However, If i enable SyntheticaLookAndFeel, and lunch the application, it will throw the following exception continuously;

Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: java.lang.ClassNotFoundException: de.javasoft.plaf.synthetica.painter.StatusBarPainter
at de.javasoft.plaf.synthetica.painter.SyntheticaComponentPainter.getInstance(SyntheticaComponentPainter.java:83)
at de.javasoft.plaf.synthetica.painter.SyntheticaAddonsPainter.getInstance(SyntheticaAddonsPainter.java:40)
at com.jidesoft.plaf.synthetica.SyntheticaJidePainter.paintStatusBarBackground(Unknown Source)
at com.jidesoft.status.StatusBar.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(JComponent.java:1029)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:567)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5131)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1479)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1410)
at javax.swing.RepaintManager.paint(RepaintManager.java:1224)
at javax.swing.JComponent.paint(JComponent.java:1015)
at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
at java.awt.Container.paint(Container.java:1780)
at java.awt.Window.paint(Window.java:3375)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:796)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:713)
at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:693)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:125)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.ClassNotFoundException: de.javasoft.plaf.synthetica.painter.StatusBarPainter
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at de.javasoft.plaf.synthetica.painter.SyntheticaComponentPainter.getInstance(SyntheticaComponentPainter.java:72)

jide Version : 2.9.7
Synthetica Version : 2.14.1_eval

This is how I enabled synthetica;

SyntheticaSkyMetallicLookAndFeel laf = new SyntheticaSkyMetallicLookAndFeel();
SyntheticaLookAndFeel.setWindowsDecorated(false);
UIManager.setLookAndFeel(laf);
LookAndFeelFactory.installJideExtension();
safesoft
 
Posts: 8
Joined: Thu Apr 01, 2010 5:19 pm

Re: Exception when changing L&F during runtime

Postby JIDE Support » Thu Jan 12, 2012 4:04 pm

I'm afraid that you might have to turn to Synthetica to ask for their help since it's one of Synthetica class that is missing.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 36466
Joined: Sun Sep 14, 2003 10:49 am

Re: Exception when changing L&F during runtime

Postby safesoft » Thu Jan 12, 2012 5:42 pm

Thank you for your help. appreciated.
safesoft
 
Posts: 8
Joined: Thu Apr 01, 2010 5:19 pm


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 4 guests