The Artima Developer Community
Sponsored Link

Java Answers Forum
package import.

6 replies on 1 page. Most recent reply: Oct 6, 2003 6:39 PM by mr.mann

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 6 replies on 1 page
mr.mann

Posts: 6
Nickname: mister
Registered: Oct, 2003

package import. Posted: Oct 5, 2003 6:36 PM
Reply to this message Reply
Advertisement
hey guys, im fairly new at this language.
im using the borland jdk and my code will compile with no
errors with the gui, but will not run.
from the command line I recieve the following error message.
C:\java>javac expenseAccount2.java
expenseAccount2.java:12: Package com.sun.java.swing not found in import.
import com.sun.java.swing.*;
^
expenseAccount2.java:13: Package borland.jbcl.layout not found in import.
import borland.jbcl.layout.*;
^
expenseAccount2.java:14: Package borland.jbcl.control not found in import.
import borland.jbcl.control.*;
^
// I suspect the classpath to have something to do with this
error,along with the suspicion of the jvm and the compiler being set on different paths.

Im just not sure what to do about it!!.


here are the opening statements of my code...

import java.io.*;
import java.applet.*;
import java.awt.event.*;
import java.awt.event.ActionListener;
import java.awt.event.MouseListener;
import java.util.*;
import java.lang.*;
import java.text.*;
import com.sun.java.swing.*;
import borland.jbcl.layout.*;
import borland.jbcl.control.*;


public class expenseAccount2 extends Applet implements ActionListener,MouseListener {
/*first declare all needed objects*/


ArcherDaPunk

Posts: 2
Nickname: archer
Registered: Oct, 2003

Re: package import. Posted: Oct 5, 2003 11:04 PM
Reply to this message Reply
Are you sure all those packages are in your class path?? If they're not add them.

koala114

Posts: 1
Nickname: koala114
Registered: May, 2003

Re: package import. Posted: Oct 5, 2003 11:09 PM
Reply to this message Reply
Windows XP Environment Variables
path
;C:\j2sdk1.4.1_01\bin
classpath
.;C:\j2sdk1.4.1_01\lib\dt.jar;C: \j2sdk1.4.1_01\tools.jar

Joe Parks

Posts: 107
Nickname: joeparks
Registered: Aug, 2003

Re: package import. Posted: Oct 6, 2003 3:36 AM
Reply to this message Reply
The com.sun.java.swing package was moved to javax.swing. That is, the import at line 12 should be
import javax.swing.*;

mr.mann

Posts: 6
Nickname: mister
Registered: Oct, 2003

Re: package import. Posted: Oct 6, 2003 6:38 PM
Reply to this message Reply
thanx

mr.mann

Posts: 6
Nickname: mister
Registered: Oct, 2003

Re: package import. Posted: Oct 6, 2003 6:39 PM
Reply to this message Reply
thanx

mr.mann

Posts: 6
Nickname: mister
Registered: Oct, 2003

Re: package import. Posted: Oct 6, 2003 6:39 PM
Reply to this message Reply
thanx

Flat View: This topic has 6 replies on 1 page
Topic: Math Script Ideas Previous Topic   Next Topic Topic: Help me!!!!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use