NPE in FastGradientPainter

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.

NPE in FastGradientPainter

Postby pentavalle » Wed Jan 07, 2009 11:59 am

Hi, i have a problem with a JideTabbedPane.
Same app on windowx xp runs fine, but on ubuntu 8.10 give this error:
Code: Select all
Exception occurred during event dispatching:
java.lang.NullPointerException
   at com.jidesoft.swing.FastGradientPainter.createGradientTile(Unknown Source)
   at com.jidesoft.swing.FastGradientPainter.drawGradient(Unknown Source)
   at com.jidesoft.swing.JideSwingUtilities.fillGradient(Unknown Source)
   at com.jidesoft.plaf.eclipse.Eclipse3xJideTabbedPaneUI.paintTabBackground(Unknown Source)
   at com.jidesoft.plaf.basic.BasicJideTabbedPaneUI.paintTab(Unknown Source)
   at com.jidesoft.plaf.eclipse.Eclipse3xJideTabbedPaneUI.paintTabArea(Unknown Source)
   at com.jidesoft.plaf.basic.BasicJideTabbedPaneUI$ScrollableTabPanel.paintComponent(Unknown Source)
   at javax.swing.JComponent.paint(JComponent.java:1027)

I use JIDE Common 2.4.8.
What's wrong with that?
pentavalle
 
Posts: 9
Joined: Tue Aug 05, 2008 1:54 am

Re: NPE in FastGradientPainter

Postby JIDE Support » Wed Jan 07, 2009 12:28 pm

Could you please get the source code from JIDE Common Layer at https://jide-oss.dev.java.net and use it so that we can see the exact line # in the stack trace?
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37263
Joined: Sun Sep 14, 2003 10:49 am

Re: NPE in FastGradientPainter

Postby pentavalle » Wed Jan 07, 2009 12:37 pm

Uhm, i discovered that this exception disappear if i use XERTO_STYLE. previously i used ECLIPSE3X_STYLE.
Must i compile JIDE Common Layer manually to use it with debug informations?
pentavalle
 
Posts: 9
Joined: Tue Aug 05, 2008 1:54 am

Re: NPE in FastGradientPainter

Postby JIDE Support » Wed Jan 07, 2009 12:47 pm

Probably a color UI resource is null under eclipse style. You could use the pre-compile jar under documents and files section on that site.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37263
Joined: Sun Sep 14, 2003 10:49 am

Re: NPE in FastGradientPainter

Postby pentavalle » Wed Jan 07, 2009 1:34 pm

FastGradientPainter:77
info.startcolor = null

This is the cause of the NPE. Hope this will help you.
pentavalle
 
Posts: 9
Joined: Tue Aug 05, 2008 1:54 am

Re: NPE in FastGradientPainter

Postby JIDE Support » Wed Jan 07, 2009 5:03 pm

I don't have an ubuntu to test at the moment. On Window, even I set the L&F to Metal, it still runs fine. Could you please do me a favor and debug into Eclipse3xJideTabbedPaneUI.paintTabBackground method and let me know what is null? There are two background colors.

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

Re: NPE in FastGradientPainter

Postby pentavalle » Thu Jan 08, 2009 5:32 am

background1 = null
pentavalle
 
Posts: 9
Joined: Tue Aug 05, 2008 1:54 am

Re: NPE in FastGradientPainter

Postby JIDE Support » Thu Jan 08, 2009 10:25 am

That's weird. It sounds like UIDefault "activeCaption" is null in the L&F you are using. Which L&F are you using?

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

Re: NPE in FastGradientPainter

Postby pentavalle » Thu Jan 08, 2009 11:09 am

GTK+, system default on ubuntu (Gnome based)
pentavalle
 
Posts: 9
Joined: Tue Aug 05, 2008 1:54 am

Re: NPE in FastGradientPainter

Postby JIDE Support » Thu Jan 08, 2009 11:36 am

We have GTKInitializer which set the "activeCaption" UIDefault. You can see it in LookAndFeelFactory. Are you on the latest version?

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

Re: NPE in FastGradientPainter

Postby pentavalle » Thu Jan 08, 2009 2:51 pm

I agree, in GTKInitializer "activeCaption" is correctly setted... I have no ideas, tell me if i can be useful with other tests.
I am using 2.4.8 version and java 6u10.
pentavalle
 
Posts: 9
Joined: Tue Aug 05, 2008 1:54 am

Re: NPE in FastGradientPainter

Postby JIDE Support » Thu Jan 08, 2009 3:00 pm

Could you please debug to see if GTKInitializer is called, then put a bp at paintTabBackground and inspect UIDefault.get("activeCaption")? I can only guess GTKInitializer is not called for some reason. Otherwrise it should work.

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

Re: NPE in FastGradientPainter

Postby pentavalle » Tue Jan 13, 2009 3:09 am

I can confirm you that GTKInitializer is called. I didn't understand where to put UIDefault.get("activeCaption"), so i put a bp in Eclipse3xJideTabbedPaneUI.paintTabBackground and the expression UIDefaultsLookup.getColor("activeCaption") gave me a ColorUIResource with r=250, g=209, b=132.
pentavalle
 
Posts: 9
Joined: Tue Aug 05, 2008 1:54 am

Re: NPE in FastGradientPainter

Postby JIDE Support » Tue Jan 13, 2009 8:53 am

You could debug the paintTabBackground method line by line and find out why the background1 is null. It is surprise because background1 is assigned from UIDefaultsLookup.getColor("DockableFrame.activeTitleBackground") which in turned assigned from UIDefault.get("activeCaption"). If UIDefault.get("activeCaption") is not null, background1 shouldn't be null either.

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

Re: NPE in FastGradientPainter

Postby pentavalle » Mon Jan 19, 2009 2:49 pm

I am not sure, but it seems that "DockableFrame.activeTitleBackground" is setted in 2 classes: EclipseWindowsUtils and EclipseMetalUtils, but none of them is called...
pentavalle
 
Posts: 9
Joined: Tue Aug 05, 2008 1:54 am

Re: NPE in FastGradientPainter

Postby JIDE Support » Tue Jan 20, 2009 2:18 pm

That's weird. I looked at LookAndFeelFactory.java (btw, the source code for it is available on https://jide-oss.dev.java.net) and didn't see a reason EclipseMetalUtils is not used even for Ubuntu (the installJideExtension is the method that calls this). GTK L&F is considered if you look at the source code of LookAndFeelFactory.java:700 and the next switch statement will call EclipseMetalUtils. It would be helpful to see a test case that I can run on Ubuntu to reproduce the exception.

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


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

Who is online

Users browsing this forum: Bing [Bot] and 9 guests