This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Error in Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Error in "Headfirst Java"" Watch "Error in "Headfirst Java"" New topic

Error in "Headfirst Java"

George Sarbu

Joined: Mar 08, 2009
Posts: 6

Hello! When I try to compile a code from the great book "Head First Java",chapter 12(about GUI), i got an error.
The code is:

import javax.swing.*;
import java.awt.event.*;

public class SimpleGui1B implements ActionListener {

public static void main(String[] args) {

SimpleGui1B gui=new SimpleGui1B();

public void go() {

JFrame frame=new JFrame();

JButton buton=new JButton("click");




frame.setSize(400, 300);


public void actionPerformed(ActionEvent event) {
buton.setText("I've been clicked");


cannot find symbol
symbol:variable buton
location: class SimpleGui1B
buton,setText("I've been clicked")
1 error

Please help me !!!
xiss burg

Joined: Mar 04, 2009
Posts: 3

I agree. Here's the link:
subject: Error in "Headfirst Java"
It's not a secret anymore!