473,395 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 14687
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Hal Vaughan | last post by:
I'm using JDK 1.4.1 for Java 2. According to the API docs, I can use javax packages, but when I add: import javax.crypto; I get an error that it can't find the package. Is there some special...
2
by: Pavel | last post by:
Greetings to all - I'm having a problem processing xml with relative dtd URI specified using XSLT: <?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE mydoc SYSTEM "my.dtd"> <mydoc> .......
1
by: Shiva48 | last post by:
Thanks to Gannon11 and ro351988- Moderator. I give below the complete Java file and pls help me to rectify the errors. package com.wrox.proj2ee.ch10.app; import java.io.*; import...
8
oll3i
by: oll3i | last post by:
it worked but suddenly when i run it and click a button it throws exception ? D:\SR>java Producent queue1 queue2 queue3 queue4 queue1,queue2,queue3,queue4...
14
by: ramadeviirrigireddy | last post by:
Hi All, I have the following code for form and servlet. when the form is submitted the servlet will print the values passed by the form. i'm not getting the servlet o/p when i submit the...
4
by: shaileshkumar | last post by:
hi, when i type javap javax.servlet.Servlet on the command propmpt iam gettting the following error Error:could not find javax.servlet.Servlet plz help me proper instructions to make...
5
by: creative1 | last post by:
hi, I am new at writing JSP and Servlets. When I compile my serverlet I get follwoing error cannot find mymbol method parseDate(java.lang.String) I have follwoing code: Code: ( text )...
1
by: hdivecha | last post by:
i have make a jtree program in java and if the node is circle then the circle can be shown in frame and i have to resize it with slider . plz help me i have done the tree program bt how to get...
1
by: Man4ish | last post by:
Hi, How Eventlistner can be used with rendred combo box. I got one example of combobox in table as follows . /* * Copyright (c) 1995 - 2008 Sun Microsystems, Inc. All rights reserved. * ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.