472,133 Members | 1,039 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,133 software developers and data experts.

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 14553
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 leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.