Solved

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

Posted on 2009-04-07
2
1,664 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now