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 47149 - Exception with JGoodies L&F
Summary: Exception with JGoodies L&F
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 4.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Milos Kleint
URL:
Keywords: L&F
Depends on:
Blocks:
 
Reported: 2004-08-12 11:13 UTC by ehartmann
Modified: 2008-12-22 22:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ehartmann 2004-08-12 11:13:10 UTC
With today cvs build, I'm unable to start Netbeans
due to the following NPE :

java.lang.NullPointerException
	at
org.netbeans.swing.tabcontrol.plaf.WindowsSlidingButtonUI.installDefaults(WindowsSlidingButtonUI.java:80)
	at
javax.swing.plaf.basic.BasicButtonUI.installUI(BasicButtonUI.java:63)
	at javax.swing.JComponent.setUI(JComponent.java:650)
	at
javax.swing.AbstractButton.setUI(AbstractButton.java:1636)
	at
org.netbeans.swing.tabcontrol.SlidingButton.updateUI(SlidingButton.java:91)
	at
javax.swing.AbstractButton.init(AbstractButton.java:2003)
	at
javax.swing.JToggleButton.<init>(JToggleButton.java:145)
	at
org.netbeans.swing.tabcontrol.SlidingButton.<init>(SlidingButton.java:51)
	at
org.netbeans.core.windows.view.ui.slides.SlideBar.syncWithModel(SlideBar.java:351)
	at
org.netbeans.core.windows.view.ui.slides.SlideBar.indicesChanged(SlideBar.java:170)
	at
org.netbeans.swing.tabcontrol.DefaultTabDataModel.fireIndicesChanged(DefaultTabDataModel.java:457)
[.............]

Looking at the code, it seems that 
UIManager.get("Button.dashedRectGapX") is null.

The following little patch make this works :

	    if (UIManager.get("Button.dashedRectGapX") !=
null) {
	        dashedRectGapX =
((Integer)UIManager.get("Button.dashedRectGapX")).intValue();
	    }
	    if (UIManager.get("Button.dashedRectGapY") !=
null) {
	        dashedRectGapY =
((Integer)UIManager.get("Button.dashedRectGapY")).intValue();
	    }
	    if
(UIManager.get("Button.dashedRectGapWidth") != null) {
	        dashedRectGapWidth =
((Integer)UIManager.get("Button.dashedRectGapWidth")).intValue();
	    }
	    if
(UIManager.get("Button.dashedRectGapHeight") !=
null) {
	        dashedRectGapHeight =
((Integer)UIManager.get("Button.dashedRectGapHeight")).intValue();
	    }

But as I'm not a swing guru, I don't know if it's
a bug in JGoodies L&F or Netbeans.

I raise priority to P2 as Netbeans does not start
at all: there is no window after the splash and
the exception dialog.

I'm using JDK1.5b60 and Mandrake 10

-Eric
Comment 1 Milos Kleint 2004-08-12 12:08:25 UTC
reassigning
Comment 2 Milos Kleint 2004-08-12 13:21:30 UTC
most probably a bug on your side.
first of all on mandrake one should not get windows button.
thanks for the patch.
Comment 3 ehartmann 2004-08-12 13:38:37 UTC
I did not realize that WindowsSlidingButtonUI refers to MS Windows.
The switching lines I use is :
'/opt/netbeans/bin/netbeans' -J-Xms24m -J-Xmx160m -J-Xverify:none
--laf com.jgoodies.looks.plastic.NbPlasticXPLookAndFeel
-J-Djgoodies.popupDropShadowEnabled=true -J-DClearLook.mode=OFF
-J-DPlastic.defaultTheme=ExperienceBlue -J-DPlastic.tabStyle=Metal

The NbPlasticXPLookAndFeel is a tweaked PlasticXPLookAndFeel:

package com.jgoodies.looks.plastic;

import javax.swing.UIDefaults;

public class NbPlasticXPLookAndFeel extends PlasticXPLookAndFeel {
        /**
         * Initializes the PlasticXP component defaults.
     *
     * @param table   the UIDefaults table to work with
         */
        protected void initComponentDefaults(UIDefaults table) {
                super.initComponentDefaults(table);
                table.put("ScrollBar.width", Integer.valueOf("12"));
        }
}

Does it means that it's more likely a bug in jgoodies l&f ?
Comment 4 Milos Kleint 2004-08-13 09:26:52 UTC
fixed in trunk, by providing reasonable defauts when using custom L&F.
please verify in builds 20040814 and later.
Comment 5 Milos Kleint 2004-08-13 10:23:12 UTC
x.
Comment 6 Zdenek Konecny 2005-07-18 10:44:24 UTC
Closed, too old