I started coding java a few days ago. İ made a few succesfull programs but im stuck on this one. Where ever i write the \"Public static void main(String[] args)\" code i get
Your Board()
is actually a constructor, which cannot be created inside a method. Every class has a constructor. If one isn't coded, a default no-arg constructor is provided to you. The main problem you are facing is you are creating a constructor called Board
inside a class called Panel_Test
.
To give you a basic example of how it works:
public class Board extends JFrame {
//your fields
public Board() {//your constructor
}
//your methods
}
public class Test_Panel {
public static void main(String[] args) {
Board board = new Board();//calling your Test_Panel class' constructor
}
}
If you're new to programming and would like to become more solid with the basics, here's a nice website I've used on occasion when learning Java in my time as a programmer.