• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javax.awt.event does not exist!!!

 
divya sharma
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Garrett Rowe
Ranch Hand
Posts: 1296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The compiler is correct, javax.awt.event really doesn't exist, you want java.awt.event.
[ February 05, 2007: Message edited by: Garrett Rowe ]
 
divya sharma
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot to help me to find my silly mistake... thanks a lot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic