Solved

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

Posted on 2009-04-07
2
1,675 Views
Last Modified: 2013-12-14
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
0
Comment
Question by:foliage_
2 Comments
 
LVL 13

Accepted Solution

by:
MicheleMarcon earned 125 total points
ID: 24114942
I suggest reinstalling (or upgrading) netbeans.

However, if it still doesn't help, you may disassemble the code and get the .java file (you can use JAD http://www.varaneckas.com/jad)

Then, put the .java file into your sources, compile it and right-click on the file and select "Add to palette..."
0
 
LVL 1

Author Comment

by:foliage_
ID: 24124392
Wow I had no idea you could decompile .class files, this fixes all my problems, thank you very much.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
even odd program using while loop 3 40
tomcat administrtor 12 47
Configure a Bean in an XML file 4 31
String array comparison 4 33
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question