• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help with Kunststoff Look & Feel

 
Matt Wilcko
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to get kunststoff look and feel to work but I am not having any luck. I have following their directions which are below. I simply put the jar file in the same directory as my classes. I then add the line in my main class. I get errors from eclipse:
java.lang.Error: Unresolved compilation problem:
com.incors cannot be resolved or is not a type
I also tried using this line instead by no luck:
UIManager.setLookAndFeel("com.incors.plaf.kunststoff.KunststoffLookAndFeel");
I dont get an error with the second one when trying to compile but nothing happens to the UI. It has the same old metal look.

Thanks,
matt

Directions from the kunststoff site that I cant get to work:
To use the Kunststoff Look&Feel in your application you just have to include the kunstoff.jar-file into the classpath of your application and put this line into your code:

UIManager.setLookAndFeel(new com.incors.plaf.kunststoff.KunststoffLookAndFeel());
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Putting a JAR file into a directory accomplishes nothing (unless the directory is the standard extensions directory inside the JRE installation.) "Putting a JAR on the CLASSPATH" involves putting the name of the actual JAR file into the CLASSPATH, not the directory in which the JAR file appears. So, for example, you might have your CLASSPATH set to include two entries: dot (.) for the current directory, and the actual JAR file itself, like
.;C:\kunststoff\kunststoff.jar
OK?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To do this through Eclipse, right click on your project in the Package Explorer and choose 'Properties'. Choose 'Java Build Path' on the left of the Properties Dialog, then choose the 'Libraries' tab on the panel that shows up. Click the 'Add External JARs...' button on the right and browse to the JAR file you want to add to the classpath. The JAR file is added to the list in the center of the panel. Click 'OK' to save this and you should be able to import the class you need now.
 
Matt Wilcko
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.. got it to work.. Now I have another problem:
When I create a jar of my program, I include this jar into it and it stops working. Can you include a jar inside of another jar? Are you supposed to do something else?
Thanks.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, if you want to deploy as one single jar file, you have to un-jar the other ones and then jar all the contents all together into one file.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, there are lots of ways of doing this... and JARring the contents of the other JAR is not the best way of doing this...

One way is to point to the other JAR file with the -cp option when you run...


This is kinda klunky because you'll probably want to make some kind of script launch the program, and you can't just click and run the jar file directly, but have to run the script instead.

The better way is to include a line in your manifest that points to the JAR files needed by your JAR files through a relative path. The manifest file for your JAR file should contain the line :


Which means that your JAR file needs to find the kunststoff.jar file in the directory called 'lib' below the directory that your JAR file is in. This way you don't have to have a script file to run, and you can click and run the JAR file directly.

Some of the reasons you don't want to unJar another JAR file and JAR it into your own are because you have just tied your application forever to that version (AKA 'tightly coupled'). If INCORS releases a new version of kunststoff next week, users can just dump the new kunststoff.jar into the lib directory and (most probably) be off and running. Another reason is that packaging libraries with your JAR may pose a problem with the license of that library. Kunststoff uses the LGPL... if you include the classes inside your JAR file you'll have to be sure to include the LGPL yourself with the code, etc. If you bundle the self contained JAR with your application or point the user to INCORS to download it you don't have this problem.

Of course, you probably aren't concerned with all this right now, and probably aren't distributing your code to anyone. This is just to let you know that making one monolithic JAR file out of all the libraries you need isn't the best approach.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Class-Path: lib/kunststoff.jar

I didn't know about this; that's cool!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!