|
-
Oct 29th, 2005, 09:48 PM
#1
Thread Starter
Hyperactive Member
import java.swing.*; error - [SOLVED]
I get package java.swing does not exist. I am using BlueJ to test this sample and lo and behold it's not working for me. Is it not importing something correctly?
Code:
/* Wel.java
An applet to illustrate the display of a string
*/
import java.applet.*;
import java.swing.*;
import java.awt.*;
public class Wel extends JApplet
{
// Create a content pane and a panel
Container messageArea = getContentPane();
MessagePanel myMessagePanel = new MessagePanel();
// The init method adds the panel to the applet
public void init()
{
messageArea.add( myMessagePanel );
}
}
// The panel class on which the message is painted
class MessagePanel extends JPanel
{
// The paintComponent method for this class
public void paintComponent( Graphics grafObj )
{
grafObj.drawString( "Welcome to my home page!", 50, 50 );
}
}
Last edited by gjon; Oct 29th, 2005 at 10:05 PM.
-
Oct 29th, 2005, 10:05 PM
#2
Thread Starter
Hyperactive Member
Re: import java.swing.*; error
Got it, it's javax.swing. Thanks for looking.
-
Nov 2nd, 2005, 08:13 AM
#3
Lively Member
Re: import java.swing.*; error - [SOLVED]
Bluej sucks! One of my online classes is 'teaching' me Java using BlueJ. His instrcutions suck, he won't answer questions and he dislikes me because I informed him of his falure to provide adequet instruction. His reply was, "The poor instructions are not my fault, KVHS purchased them from Florida." Why would you purchase a class for programming from Florida, they can't even count!
Excuse my rant
Vagabon
-
Nov 2nd, 2005, 09:43 AM
#4
Fanatic Member
Re: import java.swing.*; error - [SOLVED]
 Originally Posted by vagabon
Bluej sucks! One of my online classes is 'teaching' me Java using BlueJ. His instrcutions suck, he won't answer questions and he dislikes me because I informed him of his falure to provide adequet instruction. His reply was, "The poor instructions are not my fault, KVHS purchased them from Florida." Why would you purchase a class for programming from Florida, they can't even count!
Excuse my rant
Vagabon
So you dont like BlueJ because you have a rubbish instructor? If you are taught to programme using BlueJ by a good teacher then BlueJ is amazing. I am learning Java with BlueJ and i think is great, but only for beginners.
-
Nov 2nd, 2005, 11:19 AM
#5
Thread Starter
Hyperactive Member
Re: import java.swing.*; error - [SOLVED]
i agree with vagabon, i dislike bluej very much. I think that any class that will teach java to students should be using Java Studio Creator 2 which has an environment like visual studio. Makes learning the language a lot easier.
If you're gonna take a class, I recommend you telling your instructor to get a hold of that program over any other for using to learn java.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|