This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 204569 - [71cat] NullPointerException at com.jtattoo.plaf.BaseSliderUI.paintThumb
Summary: [71cat] NullPointerException at com.jtattoo.plaf.BaseSliderUI.paintThumb
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.1
Hardware: All All
: P3 normal (vote)
Assignee: issues@guibuilder
Depends on:
Reported: 2011-11-02 10:10 UTC by MackSix
Modified: 2011-11-03 10:07 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 182513

stacktrace (3.00 KB, text/plain)
2011-11-02 10:11 UTC, MackSix
Project that exhibits the error. (25.34 KB, application/zip)
2011-11-02 10:44 UTC, MackSix

Note You need to log in before you can comment on or make changes to this bug.
Description MackSix 2011-11-02 10:10:57 UTC
Build: NetBeans IDE Dev (Build 201110310600)
VM: Java HotSpot(TM) Client VM, 21.1-b02, Java(TM) SE Runtime Environment, 1.7.0_01-b08
OS: Windows Vista

User Comments:
MackSix: Applying custom Look and Feel per

   at com.jtattoo.plaf.BaseSliderUI.paintThumb(
   at com.jtattoo.plaf.BaseSliderUI.paint(
   at javax.swing.plaf.ComponentUI.update(
   at javax.swing.JComponent.paintComponent(
   at javax.swing.JComponent.paint(
   at javax.swing.JComponent.paintChildren(
Comment 1 MackSix 2011-11-02 10:11:06 UTC
Created attachment 112721 [details]
Comment 2 MackSix 2011-11-02 10:16:31 UTC
Should I just give up trying to test these Look and Feels?
Comment 3 MackSix 2011-11-02 10:44:31 UTC
Created attachment 112727 [details]
Project that exhibits the error.

See Item 6. in

Use and install the
twelve entries that have "LookAndFeel" in the names. (there are 12 of them)

1. Install the custom look and feels from JTattoo.jar
2. Open attached Project.
2. Right click on JFrame in Navigator and choose Preview Design and then choose
a LookAndFeel. 
3. Close running program and choose a LookAndFeel again.

This Exception is thrown.
Comment 4 Jan Stola 2011-11-02 13:04:47 UTC
Swing API doesn't allow to use several look and feels at once. Hence, the ability to preview the form in a different look and feel is just an error-prone set of hacks that attempt to show the form as it would look in a different look and feel. This functionality can be inaccurate. It is present because it works somehow for the basic look and feels and it may work well for some other look and feels, but it doesn't (and cannot work) in general for any look and feel.

I am closing this issue as 'will not fix' because it is not worth the effort to introduce even more error-prone hacks to support non-standard look and feel.
Comment 5 Jan Stola 2011-11-03 09:27:49 UTC
The attached exception is thrown by the code that paints thumb of JSlider. The corresponding UI class of JTattoo look and feel (BaseSliderUI) paints the thumb as an icon. Unfortunately, the icon is null. The code that returns the icon doesn't follow standards for look and feels: it checks explicitly what look and feel is set (using UIManager.getLookAndFeel()) and it gets the icon from the returned look and feel directly (using getIconFactory().get<iconType>) instead of using UIDefaults.

We don't modify look and feel field in UIManager during preview. Our preview in other look and feel is based on smart manipulation of UIDefaults. Hence, this bug cannot be fixed unless we rewrite the preview support completely (to use a different kind of hacks).

In other words, preview (in JTattoo look and feel) of a form that contains JSlider will always throw the mentioned exception.
Comment 6 asenk 2011-11-03 09:38:30 UTC
Wouldn't be better to remove custom L&Fs from Preview Design?
Comment 7 Jan Stola 2011-11-03 10:07:28 UTC
> Wouldn't be better to remove custom L&Fs from Preview Design?

Why so? Because it doesn't work with poorly designed look and feels? Why not to extrapolate that: shouldn't we remove the possibility to add custom component into GUI Builder because they can throw exceptions when they are poorly designed? ;o)

I guess you can see the point - it is beneficial when it works. It doesn't make sense to remove some functionality because it isn't 100% bug-free/reliable/accurate. We would end up with an almost no-op IDE otherwise.