Solved

How do I use the Swing API?

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

739 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