adding a new library .jar to your path (netbeans)

J

jason

hello!

just downloaded swing worker.

i up until now have not needed any external libraries for any of my
projects.

how do i go about adding this? if this is very dumb and is easily
solved with a link, please let me know. if i could find it by googling
i think i would have already as i tried for a bit.

thanks!
 
J

John B. Matthews

jason said:
just downloaded swing worker.

i up until now have not needed any external libraries for any of my
projects.

how do i go about adding this?

Adding this to what? What JVM version are you targeting? What build
environment are you using? Have you tried this?

if i could find it by googling i think i would have already as
i tried for a bit.

You should still try. Without knowing what you found or tried, it's
hard to suggest a way forward. For Java 5, download
swing-worker-src-1.2.zip from <https://swingworker.dev.java.net/>.

$ unzip swing-worker-src-1.2.zip
Archive: swing-worker-src-1.2.zip
creating: ...

Then run the demo outlined in the SwingWorker API:

<http://java.sun.com/javase/6/docs/api/javax/swing/SwingWorker.html>

$ ant demo
Buildfile: build.xml

init:
[mkdir] Created dir: ...

compile:
[javac] Compiling 3 source files to ...

demo:
[javac] Compiling 1 source file to ...

BUILD SUCCESSFUL
Total time: 10 seconds

Use ` ant -p` to see other build targets.

SwingWorker is included in Java 6 and later.
 
M

markspace

jason said:
just downloaded swing worker.
how do i go about adding this? if this is very dumb and is easily
solved with a link, please let me know. if i could find it by googling
i think i would have already as i tried for a bit.


This is a little on the dumb side. Do you know what the Java API is?
It's the stuff that comes with both the JRE (runtime) and the JDK
(development kit). If you see it in Sun's basic documentation, then you
already have it.

Therefore, exactly what problem are you having? As always please
provide an SSCCE.
 
J

jason

This is a little on the dumb side.  Do you know what the Java API is?
It's the stuff that comes with both the JRE (runtime) and the JDK
(development kit).  If you see it in Sun's basic documentation, then you
already have it.

Therefore, exactly what problem are you having?  As always please
provide an SSCCE.

okay, to answer all of your questions at once:

i am trying to run this code exactly:
http://java.sun.com/docs/books/tuto...y/FlipperProject/src/concurrency/Flipper.java

when i run it using the launch button here:
http://java.sun.com/docs/books/tutorial/uiswing/concurrency/interim.html

it runs perfectly.

when i bring it into net beans (i am running verison 6.8:
http://netbeans.org/downloads/index.html i am using the bundle with
all possible technologies). i am running Java JDK 1.5

now, when i download and unzip this file it is all present in my
download file (running on a mac).
if i bring this code into my netbeans developer i get the following
error:
import javax.swing.SwingWorker; //line with error

error:
cannot find symbol
symbol: class swing worker
location: package javax.swing

i am assuming this is because my netbeans is not acknowledging the
file. and i agree, i haven't bridged this in any way.

i agree it is obvious i am not too sure what i am talking about. i am
honestly trying here, and if there is anything i can do to help you
help me try and be patient.

thanks in advance.
 
M

markspace

jason said:
i am running Java JDK 1.5

The SwingWorker documentation says:

Since:
1.6

Download the latest JDK and add it to the NetBeans platform. Then
change your project properties to use Java 1.6.
 
J

jason

when i bring it into net beans (i am running verison 6.8:
http://netbeans.org/downloads/index.html i am using the bundle with
all possible technologies). i am running Java JDK 1.5
now, when i download and unzip this file it is all present in my
download file (running on a mac).


let me clarify in advance. i bring the flipper code into netbeans. a
project i created called flipper.

i have downloaded the zip for swingworker and it is in my downloads
file.

the flipper file is the code open noted above that is giving the erorr.
 
L

Lew

jason said:
when i [sic] bring it into net beans [sic] (i [sic] am running verison 6.8:
http://netbeans.org/downloads/index.html i [sic] am using the bundle with
all possible technologies). i [sic] am running Java JDK 1.5

Java 5 hit "end-of-life", that is, was officially retired by Sun on April 8,
2008, over two years ago. Java 6, the current version, was released to the
public on December 11, 2006, well over three years ago. Is there a particular
reason that you cannot use the current version of Java?

'SwingWorker' has been included with the current Java version for over three
years.
<http://java.sun.com/javase/6/webnotes/features.html>

Whether you use Java 5 or 6, be quite sure to keep up to date with the minor
version, that is, the number after the underscore in "Java 1.6.0_20" or
"1.5.0_22". As in the case of these very latest versions, there are important
security fixes and bug fixes in the minor upgrades.
 
J

John B. Matthews

jason said:
when i bring it into net beans (i am running verison 6.8:
http://netbeans.org/downloads/index.html i am using the bundle with
all possible technologies). i am running Java JDK 1.5

Download swing-worker-1.2.jar from <https://swingworker.dev.java.net/>.
Right click on your Projects > Libraries > Add JAR/Folder, and add the
JAR to the project.

On Mac OS X 10.5 and later, you can add Java 1.6 under Tools > Java
Platforms, if it's not already present.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top