Solved

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

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visual Studio 2013 and Eclipse Neon 6 70
going to wrong jsp page 2 47
Where are the c++ header files to use in Eclipse? 4 50
Java array 21 81
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

756 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