Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2009-04-07
2
Medium Priority
?
1,744 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_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
MicheleMarcon earned 500 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
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 …
Suggested Courses

719 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