Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do I use the Swing API?

Posted on 2003-11-10
5
Medium Priority
?
281 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
[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
  • 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 150 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

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…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

610 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