I have been Using a look and feel jar in my swing application to change the look and feel of my application . When i am using the jar with eclipse it is working fine , But as soon as i am creating a jar of the entire project and then running the project it is throwing an exception unable to load class or class not found.
My other jars used in the project like mysqlconnector.jar etc are working fine in the jar of my project by this look and feel jar is not working.
Maneesh Godbole wrote:Where have you put the LAF jar? Is it packaged inside your application jar?
I had kept all my jars in a separate folder called lib. And had also tried it by keeping the jars at src level.
All the jars work when i run the project through eclipse
But when i create a jar of my project through the eclipse and then try to run the same jar .
My all jars that are used in the project works except this look and feel jar
Try the following
1) Create a lib folder and place all your dependent jars in there
2) In your jar's manifest file, define the Classpath element to point to this lib folder.
Maneesh Godbole wrote:Try the following
1) Create a lib folder and place all your dependent jars in there
2) In your jar's manifest file, define the Classpath element to point to this lib folder.
The only way they can work in eclipse is because you have added them to the class path. That is the same as the classpath attribute in the manifest file I mentioned.
Maneesh Godbole wrote:The only way they can work in eclipse is because you have added them to the class path. That is the same as the classpath attribute in the manifest file I mentioned.
In my jar file also i had added the LnF jar in my class path still it is not using the same .
Is there any other way to upload the jar or any other way to change the look and feel of my swing components from default metalic
Maneesh Godbole wrote:When you try to set the LAF do you get any exception? Can you post the stack trace?
java.lang.ClassNotFoundException: com.birosoft.liquid.LiquidLookAndFeel
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at javax.swing.SwingUtilities.loadSystemClass(Unknown Source)
at javax.swing.UIManager.setLookAndFeel(Unknown Source)
This message was edited 1 time. Last update was at by Mayank Jaswal
Maneesh Godbole wrote:When you try to set the LAF do you get any exception? Can you post the stack trace?
java.lang.ClassNotFoundException: com.birosoft.liquid.LiquidLookAndFeel
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at javax.swing.SwingUtilities.loadSystemClass(Unknown Source)
at javax.swing.UIManager.setLookAndFeel(Unknown Source)
copy tyhe liquid jar file (liquidlnf.jar, liquidlnf-0.2.6.jar)in the jdk/jre/lib/ext and also in jre/lib/ext
hope this will work
At the center of non-violence stands the principle of love
.... Martin Luther King, Jr.
Maneesh Godbole wrote:When you try to set the LAF do you get any exception? Can you post the stack trace?
java.lang.ClassNotFoundException: com.birosoft.liquid.LiquidLookAndFeel
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at javax.swing.SwingUtilities.loadSystemClass(Unknown Source)
at javax.swing.UIManager.setLookAndFeel(Unknown Source)
copy tyhe liquid jar file (liquidlnf.jar, liquidlnf-0.2.6.jar)in the jdk/jre/lib/ext and also in jre/lib/ext
hope this will work
That would work, but then all Java applications anywhere have access to it, and you can only use that one version. It will override any version specified explicitly on the class path.
Setting the class path correctly seems a better approach.
Maneesh Godbole wrote:When you try to set the LAF do you get any exception? Can you post the stack trace?
java.lang.ClassNotFoundException: com.birosoft.liquid.LiquidLookAndFeel
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at javax.swing.SwingUtilities.loadSystemClass(Unknown Source)
at javax.swing.UIManager.setLookAndFeel(Unknown Source)
copy tyhe liquid jar file (liquidlnf.jar, liquidlnf-0.2.6.jar)in the jdk/jre/lib/ext and also in jre/lib/ext
hope this will work
I tried to do the changes but now a new exception is coming ,And since the lnf jar contains only .class files i am not able to get into the problem
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at com.birosoft.liquid.LiquidLookAndFeel.getBackgroundColor(LiquidLookAndFeel
.java:948)
at com.birosoft.liquid.skin.Skin.colourImage(Skin.java:463)
at com.birosoft.liquid.LiquidButtonUI.getSkinButton(LiquidButtonUI.java:199)
at com.birosoft.liquid.LiquidButtonUI.paint(LiquidButtonUI.java:183)
at com.birosoft.liquid.LiquidButtonUI.update(LiquidButtonUI.java:226)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JLayeredPane.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
Maneesh Godbole wrote:When you try to set the LAF do you get any exception? Can you post the stack trace?
java.lang.ClassNotFoundException: com.birosoft.liquid.LiquidLookAndFeel
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at javax.swing.SwingUtilities.loadSystemClass(Unknown Source)
at javax.swing.UIManager.setLookAndFeel(Unknown Source)
copy tyhe liquid jar file (liquidlnf.jar, liquidlnf-0.2.6.jar)in the jdk/jre/lib/ext and also in jre/lib/ext
hope this will work
That would work, but then all Java applications anywhere have access to it, and you can only use that one version. It will override any version specified explicitly on the class path.
Setting the class path correctly seems a better approach.
I had already tried to set the class path my all other jars are working except look and feel jar Please tell any other solution
I tried to do the changes but now a new exception is coming ,And since the lnf jar contains only .class files i am not able to get into the problem
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at com.birosoft.liquid.LiquidLookAndFeel.getBackgroundColor(LiquidLookAndFeel
.java:948)
at com.birosoft.liquid.skin.Skin.colourImage(Skin.java:463)
at com.birosoft.liquid.LiquidButtonUI.getSkinButton(LiquidButtonUI.java:199)
at com.birosoft.liquid.LiquidButtonUI.paint(LiquidButtonUI.java:183)
at com.birosoft.liquid.LiquidButtonUI.update(LiquidButtonUI.java:226)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JLayeredPane.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
Exception coming cause not return value for getBackgroundColor method. Check further information for this lnf jar. Yes, all can access if you put in jre lib, it's only quick solution to load that jar. I thought maybe something not right in your ide environtment (if you use one).. Please inform us step by step of your development process and classes that used for futher discuss..
At the center of non-violence stands the principle of love
.... Martin Luther King, Jr.