Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error Message

 
macnobach
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi macnobach,

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

Thanks!
 
Marilyn de Queiroz
Sheriff
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Java in General (beginner) since this has nothing to do with the Cattle Drive assignments.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic