Problem with substance-baseline

View: New views
5 Messages — Rating Filter:   Alert me  

Problem with substance-baseline

by Jean-Francois Poilpret-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hello Kirill,

 

I am facing a little problem with the new substance-baseline plugin.

I have a JSlider in my dialog, and when the layout manager tries to get the baseline for it, it throws a NullPointerException:

 

Caused by: java.lang.NullPointerException

            at org.jvnet.substance.baseline.SubstanceBaseline.getSliderBaseline(SubstanceBaseline.java:232)

            at org.jvnet.substance.baseline.SubstanceBaseline.getComponentBaseline(SubstanceBaseline.java:627)

            at org.jdesktop.layout.Baseline.getBaseline(Baseline.java:162)

            at org.jdesktop.layout.Baseline.getBaseline(Baseline.java:99)

            …

 

At this line of SubstanceBaseline there is:

 

int thumbHeight = 11;

// Line 232 follows:

thumbHeight = UIManager.getIcon("Slider.verticalThumbIcon").getIconHeight();

 

This line sounds strange when considering the previous line (thumbHeight = 11), shouldn’t it be simply commented out?

Note that there is a similar problem in line 206, for horizontal JSlider).

 

Please note that I wanted to create a JIRA for this, but I wondered if I should create it on substance-baseline project or substance itself.

 

Cheers

 

Jean-Francois


Parent Message unknown Re: Problem with substance-baseline

by Kirill Grouchnikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,

It would be better to create a ticket on the substance-baseline project. Note that the implementation of Substance baseline is pretty much copy-paste of Metal (hence the license). For slider, the UIManager entries are a little different, and this will be fixed.

Thanks
Kirill

----- Original Message ----
From: Jean-Francois Poilpret <jfpoilpret@...>
To: users@...
Sent: Thursday, September 13, 2007 8:18:16 AM
Subject: Problem with substance-baseline

Hello Kirill,

 

I am facing a little problem with the new substance-baseline plugin.

I have a JSlider in my dialog, and when the layout manager tries to get the baseline for it, it throws a NullPointerException:

 

Caused by: java.lang.NullPointerException

            at org.jvnet.substance.baseline.SubstanceBaseline.getSliderBaseline(SubstanceBaseline.java:232)

            at org.jvnet.substance.baseline.SubstanceBaseline.getComponentBaseline(SubstanceBaseline.java:627)

            at org.jdesktop.layout.Baseline.getBaseline(Baseline.java:162)

            at org.jdesktop.layout.Baseline.getBaseline(Baseline.java:99)

            …

 

At this line of SubstanceBaseline there is:

 

int thumbHeight = 11;

// Line 232 follows:

thumbHeight = UIManager.getIcon("Slider.verticalThumbIcon").getIconHeight();

 

This line sounds strange when considering the previous line (thumbHeight = 11), shouldn’t it be simply commented out?

Note that there is a similar problem in line 206, for horizontal JSlider).

 

Please note that I wanted to create a JIRA for this, but I wondered if I should create it on substance-baseline project or substance itself.

 

Cheers

 

Jean-Francois




Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us.

Re: Problem with substance-baseline

by aznmedia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, I got error too.

This is the source code section:
public NewJFrame() {
      try {
              UIManager.setLookAndFeel(new SubstanceLookAndFeel());
      } catch(Exception ex) {
              ex.printStackTrace();
      }
}

Exception stack trace:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/jdesktop/layout/Baseline
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at org.jvnet.substance.baseline.SubstanceBaselinePlugin.getDefaults(SubstanceBaselinePlugin.java:38)
        at org.jvnet.lafplugin.ComponentPluginManager.processAllDefaultsEntries(ComponentPluginManager.java:115)
        at org.jvnet.substance.SubstanceLookAndFeel.getDefaults(SubstanceLookAndFeel.java:3486)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:537)
        at NewJFrame.<init>(NewJFrame.java:48)
        at NewJFrame$7.run(NewJFrame.java:305)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: java.lang.ClassNotFoundException: org.jdesktop.layout.Baseline
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        ... 26 more

I'm using Netbeans 6.0.1 and created new library called substance with following jars and added to my project.
substance.jar
asm-all-2.2.2.jar
forms-1.1.0.jar
laf-plugin-50.jar
laf-widget.jar
substance-baseline.jar
substance-swingx.jar
substance-watermark-pack.jar
swingx.jar

I also added SwingX 0.9.1 to my project with all the jars they have included.
Where should be the org/jdesktop/layout/Baseline class?










       
____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
http://smallbusiness.yahoo.com/webhosting


Re: Problem with substance-baseline

by aznmedia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


aznmedia wrote:
Hi, I got error too.

This is the source code section:
public NewJFrame() {
      try {
              UIManager.setLookAndFeel(new SubstanceLookAndFeel());
      } catch(Exception ex) {
              ex.printStackTrace();
      }
}

Exception stack trace:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/jdesktop/layout/Baseline
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at org.jvnet.substance.baseline.SubstanceBaselinePlugin.getDefaults(SubstanceBaselinePlugin.java:38)
        at org.jvnet.lafplugin.ComponentPluginManager.processAllDefaultsEntries(ComponentPluginManager.java:115)
        at org.jvnet.substance.SubstanceLookAndFeel.getDefaults(SubstanceLookAndFeel.java:3486)
        at javax.swing.UIManager.setLookAndFeel(UIManager.java:537)
        at NewJFrame.<init>(NewJFrame.java:48)
        at NewJFrame$7.run(NewJFrame.java:305)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: java.lang.ClassNotFoundException: org.jdesktop.layout.Baseline
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        ... 26 more

I'm using Netbeans 6.0.1 and created new library called substance with following jars and added to my project.
substance.jar
asm-all-2.2.2.jar
forms-1.1.0.jar
laf-plugin-50.jar
laf-widget.jar
substance-baseline.jar
substance-swingx.jar
substance-watermark-pack.jar
swingx.jar

I also added SwingX 0.9.1 to my project with all the jars they have included.
Where should be the org/jdesktop/layout/Baseline class?

Oh I've fixed this but I got error again.
I added swing layout extension library to my project and org/jdesktop/layout/Baseline.java class found.

My next error (source code is the same):
Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: org.jvnet.lafwidget.LafWidgetUtilities.hasAutoScroll(Ljavax/swing/JScrollPane;)Z
        at org.jvnet.lafwidget.scroll.AutoScrollWidget.installUI(AutoScrollWidget.java:79)
        at org.jvnet.substance.SubstanceScrollPaneUI.installUI(SubstanceScrollPaneUI.java)
        at javax.swing.JComponent.setUI(JComponent.java:673)
        at javax.swing.JScrollPane.setUI(JScrollPane.java:365)
        at javax.swing.JScrollPane.updateUI(JScrollPane.java:378)
        at javax.swing.JScrollPane.<init>(JScrollPane.java:290)
        at javax.swing.JScrollPane.<init>(JScrollPane.java:336)
        at NewJFrame.initComponents(NewJFrame.java:211)
        at NewJFrame.<init>(NewJFrame.java:56)
        at NewJFrame$7.run(NewJFrame.java:306)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)




       
____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
http://smallbusiness.yahoo.com/webhosting


Parent Message unknown Re: Problem with substance-baseline

by Kirill Grouchnikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,

You do not need to add every jar that is included in the Substance distribution. Unless you're using GroupLayout in your project (from swing-layout project), you do not need the substance-baseline.jar. And you most certainly don't need asm, forms, laf-plugin and laf-widget jars in your classpath.

All you need is substance.jar. If you're using SwingX components, then you'll need swingx.jar and substance-swingx.jar. But otherwise - just add substance.jar and nothing else.

Thanks
Kirill

----- Original Message ----
From: aznmedia <digz6666@...>
To: users@...
Sent: Friday, May 23, 2008 1:34:28 AM
Subject: Re: Problem with substance-baseline




aznmedia wrote:

>
> Hi, I got error too.
>
> This is the source code section:
> public NewJFrame() {
>      try {
>              UIManager.setLookAndFeel(new SubstanceLookAndFeel());
>      } catch(Exception ex) {
>              ex.printStackTrace();
>      }
> }
>
> Exception stack trace:
> Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError:
> org/jdesktop/layout/Baseline
>        at java.lang.ClassLoader.defineClass1(Native Method)
>        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>        at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>        at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
>        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>        at
> org.jvnet.substance.baseline.SubstanceBaselinePlugin.getDefaults(SubstanceBaselinePlugin.java:38)
>        at
> org.jvnet.lafplugin.ComponentPluginManager.processAllDefaultsEntries(ComponentPluginManager.java:115)
>        at
> org.jvnet.substance.SubstanceLookAndFeel.getDefaults(SubstanceLookAndFeel.java:3486)
>        at javax.swing.UIManager.setLookAndFeel(UIManager.java:537)
>        at NewJFrame.<init>(NewJFrame.java:48)
>        at NewJFrame$7.run(NewJFrame.java:305)
>        at
> java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
>        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
>        at
> java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
>        at
> java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
>        at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
>        at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
>        at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
>        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
> Caused by: java.lang.ClassNotFoundException: org.jdesktop.layout.Baseline
>        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>        ... 26 more
>
> I'm using Netbeans 6.0.1 and created new library called substance with
> following jars and added to my project.
> substance.jar
> asm-all-2.2.2.jar
> forms-1.1.0.jar
> laf-plugin-50.jar
> laf-widget.jar
> substance-baseline.jar
> substance-swingx.jar
> substance-watermark-pack.jar
> swingx.jar
>
> I also added SwingX 0.9.1 to my project with all the jars they have
> included.
> Where should be the org/jdesktop/layout/Baseline class?
>
> Oh I've fixed this but I got error again.
> I added swing layout extension library to my project and
> org/jdesktop/layout/Baseline.java class found.
>
> My next error (source code is the same):
> Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError:
> org.jvnet.lafwidget.LafWidgetUtilities.hasAutoScroll(Ljavax/swing/JScrollPane;)Z
>        at
> org.jvnet.lafwidget.scroll.AutoScrollWidget.installUI(AutoScrollWidget.java:79)
>        at
> org.jvnet.substance.SubstanceScrollPaneUI.installUI(SubstanceScrollPaneUI.java)
>        at javax.swing.JComponent.setUI(JComponent.java:673)
>        at javax.swing.JScrollPane.setUI(JScrollPane.java:365)
>        at javax.swing.JScrollPane.updateUI(JScrollPane.java:378)
>        at javax.swing.JScrollPane.<init>(JScrollPane.java:290)
>        at javax.swing.JScrollPane.<init>(JScrollPane.java:336)
>        at NewJFrame.initComponents(NewJFrame.java:211)
>        at NewJFrame.<init>(NewJFrame.java:56)
>        at NewJFrame$7.run(NewJFrame.java:306)
>        at
> java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
>        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
>        at
> java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
>        at
> java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
>        at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
>        at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
>        at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
>        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
>
>
>
>
>       
> ____________________________________________________________________________________
> Building a website is a piece of cake. Yahoo! Small Business gives you all
> the tools to get online.
> http://smallbusiness.yahoo.com/webhosting
>



--
View this message in context: http://www.nabble.com/Problem-with-substance-baseline-tp12657112p17420684.html
Sent from the java.net - substance users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


LightInTheBox - Buy quality products at wholesale price