Link to home
Start Free TrialLog in
Avatar of foliage_
foliage_Flag for Australia

asked on

How to import java jar files into the netbeans GUI builder palette?

I have some pre made class files for a class extending a jPanel in a jar file, I do not have the source, just the .class files. Now I have made a new project, added the jar file with the .class files as a library via tools > libraries > add new

Then I added it to the palette via tools > palette > swing > add from library and picked the new one I added. It shows up correctly in the GUI builder with a picture of it (means it actually is reading the jar file correctly) however when I try and compile the project I get this error:

E:\Foliage\Documents\University\Flinders 09\ICS\Brickles\src\brickles\BricklesView.java:217: cannot find symbol
symbol : class BrickWall
location: class brickles.BricklesView
private BrickWall brickWall1;

Where the jar file is called BrickWall.jar and is located in a folder called lib I made in my project, and the main class for this library is also called BrickWall.class, my main class for the project is called BricklesView.class

Why can netbeans find it initially but then when I go to compile it can't locate the class files?

I have also tried adding just the .class files, just the .jar file, putting it as a library, in the class path, absolutely everywhere but for some reason the compiler says it cannot find the class BrickWall
ASKER CERTIFIED SOLUTION
Avatar of MicheleMarcon
MicheleMarcon
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of foliage_

ASKER

Wow I had no idea you could decompile .class files, this fixes all my problems, thank you very much.