• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do I install JGoodies Look and Feel??

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I'm not a good java programmer, and decided to give it another try. I wanted to install a new look and feel and downloaded one from jgooodies, but can't find any READMe files on how to install look and feel or even their FORMS layout.....Sorry for asking such an easy question....
 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Uris,

1 - Make sure the jar of the look and feel you want to use is in your CLASSPATH
2 - Call javax.swing.UIManager.setLookAndFeel(String) at the very beginning of your application (Note: this call throws exceptions so you must enclosed it with try/catch block).
3 - Look here for details on laf management.

Hope that helps,
 
Uris Guerra
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your help.
I checked out the link and did what you told me to do, but it doesn't work. I think JGoodies should include how to install it in their README file.
When I unpack the file, they have directory with examples. I can run the examples from that directory. But if I copy the example to any other directory, and set the classpath, it doesn't run. It gives me NoClassDefFoundError. I made sure that the jar file is in my classpath.

Thanks for your help. Wanted to try this look and feel because the native look and feel in Linux is too slow and metal is ugghhhhhhhh.
 
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure if this is the problem, but you need to have the actual jar file in your classpath and not just the folder their in.

The prefered way to set the LnF with JGoodies is

or whichever LnF you want.

This is shown in the README.html > Users Guide > Look and Theme
 
Uris Guerra
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do have actuall jar file in my classpath. In fact, I even tried setting it at compile time like this:

java -classpath .;PATH\lib.jar -jar tiny.jar

tiny.jar is a pre-compile example that comes in the zip file. When I unzip the file, and run it from that directory with that command line, it runs perfectly. However, if I copy the sample file to another directory, and try to run it with the same command line, it gives me the previous error.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you use the -jar switch, the -classpath switch is ignored. You could say something like

java -classpath .;PATH\lib.jar;PATH\tiny.jar com.foo.Bar

where "com.foo.Bar" is the name of the main class in tiny.jar.
 
Uris Guerra
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks alot Ernest, it worked. It brought a smile to my face when it worked. I've been smashing my head over it for over a day now.
 
Uris Guerra
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys, thanks alot for your help. You guys are cool. I had heard about javaranch before but it is the first time I gave it a try. This is one cozy ranch. I hope I get my hands dirty cleaning the pen. ;-)
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As a side note, the JGoodies 1.2.2 distribution has instructions here:

looks-1.2.2\docs\guide\index.html

With Look & Feel instructions:

looks-1.2.2\docs\guide\lookandtheme.html
 
reply
    Bookmark Topic Watch Topic
  • New Topic