473,728 Members | 2,045 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\Cu stomJFrame.java [line: 1]
Error: package javax does not exist

I did set my classpath variable to:

c:\j2sdk1.4.2\l ib\tools.jar;C: \j2sdk1.4.2_01\ src\javax

where C:\j2sdk1.4.2_0 1\src\javax is where javax is located.

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

import javax.swing.*;
"Asad Khan" <uo**********@y ahoo.com> skrev i melding
news:EP******** *************@n ews02.bloor.is. net.cable.roger s.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\Cu stomJFrame.java [line: 1]
Error: package javax does not exist

I did set my classpath variable to:

c:\j2sdk1.4.2\l ib\tools.jar;C: \j2sdk1.4.2_01\ src\javax

where C:\j2sdk1.4.2_0 1\src\javax is where javax is located.

What am I doing wrong?

Jul 17 '05 #2
"Asad Khan" <uo**********@y ahoo.com> wrote in message news:<EP******* **************@ news02.bloor.is .net.cable.roge rs.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\Cu stomJFrame.java [line: 1]
Error: package javax does not exist

I did set my classpath variable to:

c:\j2sdk1.4.2\l ib\tools.jar;C: \j2sdk1.4.2_01\ src\javax

where C:\j2sdk1.4.2_0 1\src\javax is where javax is located.

What am I doing wrong?


Set your classpath variable to:

c:\j2sdk1.4.2\l ib\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_0 1\src\javax\jav ax\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.JFra me;
import java.swing.JLab le;
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.spammarshal l.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\Cu stomJFrame.java [line: 1]
Error: package javax does not exist

I did set my classpath variable to:

c:\j2sdk1.4.2\l ib\tools.jar;C: \j2sdk1.4.2_01\ src\javax

where C:\j2sdk1.4.2_0 1\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.spammarshal l.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
6562
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 way to get javax packages? According to a web page at Sun, the crypto is supposed to be included with 1.4. (That's how they write it -- no 1.4.1 or 1.4.2, just written as 1.4.)
2
9403
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> .... </mydoc>
1
4927
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 javax.servlet.*; import javax.servlet.http.*; import com.wrox.proj2ee.ch12.*// The requesthandlers interface in this package. public class ShowRecordRequesthandler implements RequestHandler
8
6162
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 javax.naming.NoInitialContextException: Cannot instantiate class: org.exolab.jms .jndi.InitialContextFactory at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6 57) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288 )
14
2414
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 form.here is my code:(simple code just for testing i did this program) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title...
4
4120
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 it work thanks
5
3495
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 ) package admin; import java.lang.Object.*;
1
3676
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 selected node means its circle of any thing else i can't get it .. someone plz help me i have attached my program with this import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener;
1
3538
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. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met:
0
8759
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9424
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9277
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9198
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9135
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8133
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4793
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3236
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2161
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.