Hi, im about to go through O'Reilly's
Java Head First book. At page 364, there's a creation of an own widget, that i can't get to run. Compilation is ok, but when executing .class then i get the following Exception:
Exception in
thread "main" java.lang.NoSuchMethodError: main
Here's the code, can somebody help me out? Thanks in advance, Patrick
import java.awt.*;
import javax.swing.*;
public class Animation {
public void main (
String[] args) {
JFrame frame = new JFrame();frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);MeinZeichenPanel mzp = new MeinZeichenPanel();
frame.getContentPane().add(mzp);
frame.setSize(300,300);
frame.setVisible(true);
}
class MeinZeichenPanel extends JPanel {
public void paintComponent(Graphics g) {
g.setColor(Color.orange);
g.fillRect(20,50,100,100);
}
}
}