Solved

How do I use the Swing API?

Posted on 2003-11-10
5
254 Views
Last Modified: 2010-03-31
I have netbeans installed and need to use the Swing API to do some simple GUI stuff in a program I am writing.  When I use the line:
import javax.swing.*;
The package javax.swing cannot be found.  How do I get over this problem.  I am using windows xp.

Thanks
Ashley :-)
0
Comment
Question by:ashleycoker
  • 2
  • 2
5 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 9717526
Check that you don't have an active SDK of < 1.2
0
 
LVL 15

Expert Comment

by:Javatm
ID: 9718102
>> The package javax.swing cannot be found

      Have already seen the requirements you need the jdk:
      http://www.netbeans.org/downloads/ide/index.html

      Did you already downloaded the jdk ?
      If not download the latest from this site.
      http://java.sun.com/webapps/download/DisplayLinks

      Then install it.

      If you are already using the jdk :

      1.) Make sure your using 1.2 ++
      2.) Install it in its default directory.

Hope this helps . . .
JAVATM
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9718413
Of course, if you don't have *any* SDK at all, then you'll have to get one, although the link above seems rather odd.

  http://java.sun.com/getjava

should be better
0
 
LVL 15

Accepted Solution

by:
Javatm earned 50 total points
ID: 9718738
>> http://java.sun.com/getjava

      I dont think this is the link for jdk, Its only for an automatic or manual download of java virtual machine
      not a link for jdk :)
 
      This is much better :
      http://java.sun.com/j2se/1.4.2/download.html
0
 
LVL 92

Expert Comment

by:objects
ID: 9719743
You don't need to upgrade your JDK, you can just install the Swing classes.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
changeXy challenge 13 58
Books that can get me started on JAVA 2 56
wordmultiple challenge 12 92
groovy example issue 10 70
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
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…
The viewer will learn how to implement Singleton Design Pattern in Java.
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.

746 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

15 Experts available now in Live!

Get 1:1 Help Now