GeeCON Prague 2014*
The moose likes Cattle Drive and the fly likes Error Message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Error Message" Watch "Error Message" New topic
Author

Error Message

macnobach
Greenhorn

Joined: Oct 09, 2002
Posts: 3
"The applet App does not have a public constructor App()"
Can anyone tell me why this ERROR message comes up?

Here is my program:
import java.awt.*;
import java.awt.event.*;
public class App extends Frame implements WindowListener, ActionListener {
Button clear, calc;
public static void main(String[] args) {
App myWindow = new App("Border Layout");
myWindow.setSize(600,400);
myWindow.setVisible(true);
}
public App(String title) {
super(title);
setLayout(new BorderLayout());
addWindowListener(this);
clear = new Button("Clear");
add(clear, BorderLayout.EAST);
clear.addActionListener(this);
calc = new Button("Calculate");
add(calc, BorderLayout.EAST);
calc.addActionListener(this);
}
public void actionPerformed(ActionEvent e) {
if (((Button)e.getSource()).getActionCommand().equals("clear")) {
calc.setBackground(this.getBackground());

}
if (((Button)e.getSource()).getActionCommand().equals("calc")) {
}
}

public void windowClosing(WindowEvent e) {
dispose();
System.exit(0);
}
public void windowOpened(WindowEvent e) {}
public void windowActivated(WindowEvent e) {}
public void windowIconified(WindowEvent e) {}
public void windowDeiconified(WindowEvent e) {}
public void windowDeactivated(WindowEvent e) {}
public void windowClosed(WindowEvent e) {}
} Error Message
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9046
    
  10
Hi macnobach,

Welcome to JavaRanch! Please adjust your display name to meet the JavaRanch Naming Policy.
You can change it here.

Thanks!


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9046
    
  10
Moving to Java in General (beginner) since this has nothing to do with the Cattle Drive assignments.
 
GeeCON Prague 2014
 
subject: Error Message