wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes javax.awt.event does not exist!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "javax.awt.event does not exist!!!" Watch "javax.awt.event does not exist!!!" New topic
Author

javax.awt.event does not exist!!!

divya sharma
Ranch Hand

Joined: Jan 25, 2007
Posts: 87
Hello,

I am running this program;
import javax.swing.*;
import javax.awt.event.*;

public class SimpleGui1B implements ActionListener
{
JButton button;

public static void main(String[] args)
{
SimpleGui1B gui = new SimpleGui1B();
gui.go();
}

public void go()
{
JFrame frame = new JFrame();
button = new JButton("click me");

button.addActionListner(this);

frame.getContantPane().add(button);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300,300);
frame.setVisible(true);
}
public void actionPerformed(ActionEvent event)
{
button.setText("I've been clicked");
}

}

While compiling error displayed

E:\Java Program\Head First\ch12\SimpleGui1B.java:2: package javax.awt.event does not exist
import javax.awt.event.*;

Help me resolve it.Please let me know how to resolve it.


Thanks
Divya


Divya
Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1296
The compiler is correct, javax.awt.event really doesn't exist, you want java.awt.event.
[ February 05, 2007: Message edited by: Garrett Rowe ]

Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
divya sharma
Ranch Hand

Joined: Jan 25, 2007
Posts: 87
Thanks a lot to help me to find my silly mistake... thanks a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javax.awt.event does not exist!!!
 
Similar Threads
Button's action event in Head first java
Help With HeadFirst Java Chapter 12 page 360
Cannot figure out what I forgot to set, or I set wrong, or forgot to install?
code error
understanding simple gui code