Solved

How do I use the Swing API?

Posted on 2003-11-10
5
258 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
topping1 challenge 7 73
Eclipse Neon and jdk 1.8.0 11 138
JDeveloper 12c for 32 bit 4 71
split string containing \r\n in Java 46 38
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

895 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

12 Experts available now in Live!

Get 1:1 Help Now