I've assembled a basic GUI but the debugger says there is no main method even though there is a static void main(String[] args)
here is my code
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class GUI implements ActionListener {
static void main(String[] args) {
new GUI();
}
public GUI() {
JFrame frame = new JFrame();
JPanel panel = new JPanel();
JButton button = new JButton(String.valueOf(Game.Compounds));
button.addActionListener(this);
panel.setBorder(BorderFactory.createEmptyBorder(30, 30, 10, 30));
panel.setLayout(new GridLayout(0, 1));
panel.add(button);
frame.add(panel, BorderLayout.CENTER);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setTitle("GUI");
frame.pack();
frame.setVisible(true);
}
public void actionPerformed(ActionEvent e) {
Game.Compounds = Game.Compounds + Game.CPC;
}
}
What is wrong with it