469,290 Members | 1,913 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

Can't find Javax

Hi,

I am using DrJava, and I am writing a program that has the following
statement:

import javax.swing;

It gives me this error when compiled:

File: C:\Program Files\DrJava\CustomJFrame.java [line: 1]
Error: package javax does not exist

I did set my classpath variable to:

c:\j2sdk1.4.2\lib\tools.jar;C:\j2sdk1.4.2_01\src\j avax

where C:\j2sdk1.4.2_01\src\javax is where javax is located.

What am I doing wrong?
Jul 17 '05 #1
5 14354
Are you sure you don't mean:

import javax.swing.*;
"Asad Khan" <uo**********@yahoo.com> skrev i melding
news:EP*********************@news02.bloor.is.net.c able.rogers.com...
Hi,

I am using DrJava, and I am writing a program that has the following
statement:

import javax.swing;

It gives me this error when compiled:

File: C:\Program Files\DrJava\CustomJFrame.java [line: 1]
Error: package javax does not exist

I did set my classpath variable to:

c:\j2sdk1.4.2\lib\tools.jar;C:\j2sdk1.4.2_01\src\j avax

where C:\j2sdk1.4.2_01\src\javax is where javax is located.

What am I doing wrong?

Jul 17 '05 #2
"Asad Khan" <uo**********@yahoo.com> wrote in message news:<EP*********************@news02.bloor.is.net. cable.rogers.com>...
Hi,

I am using DrJava, and I am writing a program that has the following
statement:

import javax.swing;

It gives me this error when compiled:

File: C:\Program Files\DrJava\CustomJFrame.java [line: 1]
Error: package javax does not exist

I did set my classpath variable to:

c:\j2sdk1.4.2\lib\tools.jar;C:\j2sdk1.4.2_01\src\j avax

where C:\j2sdk1.4.2_01\src\javax is where javax is located.

What am I doing wrong?


Set your classpath variable to:

c:\j2sdk1.4.2\lib\tools.jar;C:\j2sdk1.4.2_01\src

java will look in the classpath for the rest. In order for your
previously stated classpath to work, you would have had to have a
directory structure that looked like:

C:\j2sdk1.4.2_01\src\javax\javax\swing\*

mypetrock
Jul 17 '05 #3
Asad,
javax.swing is a package, not a class. Therefore, either you need to type:

import java.swing.*;

or individual classes like:

import java.swing.JFrame;
import java.swing.JLable;
KB
--
------------------------------------------------------------------------
This email is certified to be Spam free by Spam Marshall

You don't pay to get spam, why pay to clean it?
Visit http://www.spammarshall.com to create an account for free
<http://www.spammarshall.com>

------------------------------------------------------------------------
Asad Khan wrote:
Hi,

I am using DrJava, and I am writing a program that has the following
statement:

import javax.swing;

It gives me this error when compiled:

File: C:\Program Files\DrJava\CustomJFrame.java [line: 1]
Error: package javax does not exist

I did set my classpath variable to:

c:\j2sdk1.4.2\lib\tools.jar;C:\j2sdk1.4.2_01\src\j avax

where C:\j2sdk1.4.2_01\src\javax is where javax is located.

What am I doing wrong?

Jul 17 '05 #4
While it was 17/10/03 11:30 am throughout the UK, Kathy Benson sprinkled
little black dots on a white screen, and they fell thus:
Asad,
javax.swing is a package, not a class. Therefore, either you need to type:

import java.swing.*;

<snip>

java.swing.*? javax.swing.* perhaps?

Stewart.

--
My e-mail is valid but not my primary mailbox. Please keep replies on
on the 'group where everyone may benefit.

Jul 17 '05 #5
Thank you for correcting it.

KB

--
------------------------------------------------------------------------
This email is certified to be Spam free by Spam Marshall

You don't pay to get spam, why pay to clean it?
Visit http://www.spammarshall.com to create an account for free
<http://www.spammarshall.com>

------------------------------------------------------------------------
Stewart Gordon wrote:
While it was 17/10/03 11:30 am throughout the UK, Kathy Benson sprinkled
little black dots on a white screen, and they fell thus:
Asad,
javax.swing is a package, not a class. Therefore, either you need to
type:

import java.swing.*;


<snip>

java.swing.*? javax.swing.* perhaps?

Stewart.

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Hal Vaughan | last post: by
1 post views Thread by Shiva48 | last post: by
1 post views Thread by hdivecha | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.