Bug 57365 - Selected LAF is not correctly setup due to call of UIManager.setLookAndFeel too late
Summary: Selected LAF is not correctly setup due to call of UIManager.setLookAndFeel t...
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.12
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2014-12-18 13:35 UTC by UbikLoadPack support
Modified: 2014-12-20 13:54 UTC (History)
1 user (show)



Attachments
Patch fixing issue (2.05 KB, patch)
2014-12-18 13:39 UTC, UbikLoadPack support
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description UbikLoadPack support 2014-12-18 13:35:16 UTC
When selecting non System LAF, some Windows do not use it due to UIManager.setLookAndFeel  being called too late.
For example, under Mac OSX, if you set LAF to Nimbus then restart, LAF is used by MainFrame but Function Helper Dialog still uses System LAF and we get NPE when clicking on Select Box to choose a function.

2014/12/18 14:34:29 ERROR - jmeter.JMeter: Uncaught exception:  java.lang.NullPointerException
	at com.apple.laf.AquaMenuPainter.paintSelectedMenuItemBackground(AquaMenuPainter.java:131)
	at com.apple.laf.AquaComboBoxRendererInternal.paintComponent(AquaComboBoxRenderer.java:129)
	at javax.swing.JComponent.paint(JComponent.java:1037)
	at javax.swing.CellRendererPane.paintComponent(CellRendererPane.java:134)
	at javax.swing.plaf.basic.BasicListUI.paintCell(BasicListUI.java:209)
	at javax.swing.plaf.basic.BasicListUI.paintImpl(BasicListUI.java:299)
	at javax.swing.plaf.basic.BasicListUI.paint(BasicListUI.java:222)
	at javax.swing.plaf.ComponentUI.update(ComponentUI.java:153)
	at javax.swing.JComponent.paintComponent(JComponent.java:760)
	at javax.swing.JComponent.paint(JComponent.java:1037)
	at javax.swing.JComponent.paintChildren(JComponent.java:870)
	at javax.swing.JComponent.paint(JComponent.java:1046)
	at javax.swing.JViewport.paint(JViewport.java:795)
	at javax.swing.JComponent.paintChildren(JComponent.java:870)
	at javax.swing.JComponent.paint(JComponent.java:1046)
	at javax.swing.JComponent.paintChildren(JComponent.java:870)
	at javax.swing.JComponent.paint(JComponent.java:1046)
	at javax.swing.JComponent.paintChildren(JComponent.java:870)
	at javax.swing.JComponent.paint(JComponent.java:1046)
	at javax.swing.JComponent.paintChildren(JComponent.java:870)
	at javax.swing.JComponent.paint(JComponent.java:1046)
	at javax.swing.JLayeredPane.paint(JLayeredPane.java:567)
	at javax.swing.JComponent._paintImmediately(JComponent.java:5106)
	at javax.swing.JComponent.paintImmediately(JComponent.java:4890)
	at javax.swing.RepaintManager$3.run(RepaintManager.java:814)
	at javax.swing.RepaintManager$3.run(RepaintManager.java:802)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:802)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:745)
	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:725)
	at javax.swing.RepaintManager.access$1000(RepaintManager.java:46)
	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1680)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
	at java.awt.EventQueue.access$400(EventQueue.java:82)
	at java.awt.EventQueue$2.run(EventQueue.java:676)
	at java.awt.EventQueue$2.run(EventQueue.java:674)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Comment 1 UbikLoadPack support 2014-12-18 13:39:11 UTC
Created attachment 32303 [details]
Patch fixing issue
Comment 2 Philippe Mouawad 2014-12-19 21:30:06 UTC
Date: Fri Dec 19 21:28:43 2014
New Revision: 1646876

URL: http://svn.apache.org/r1646876
Log:
Bug 57365 - Selected LAF is not correctly setup due to call of UIManager.setLookAndFeel too late
Bugzilla Id: 57365

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/JMeter.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/LookAndFeelCommand.java
    jmeter/trunk/xdocs/changes.xml
Comment 3 Philippe Mouawad 2014-12-20 13:54:25 UTC
Date: Sat Dec 20 13:52:24 2014
New Revision: 1646980

URL: http://svn.apache.org/r1646980
Log:
Bug 57365 - Selected LAF is not correctly setup due to call of UIManager.setLookAndFeel too late
Fix test failure
Bugzilla Id: 57365

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/JMeter.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/LookAndFeelCommand.java