0
1.Can anyone find the main class name in this program,2.is there any mistake in this code plz correct it thanks in advance
https://code.sololearn.com/caF6up0fnTR8/?ref=app https://code.sololearn.com/caF6up0fnTR8/?ref=app
2 odpowiedzi
+ 1
Swing is not supported on codeplayground & android. So, it won't work on Sololearn regardless of if there are no errors or not.
There is no class with the main method in this file. As a comment writes in Github, add the following to the code:
// Keep this import in same file as main
/* Only need to add it if you put main in different file */
import javax.swing.JFrame;
// main class
// can put this wherever
// Its name should match the file name
public class Program
{
public static void main(String[] args){
JFrame frame = new JFrame(); frame.setSize(1920,1080); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Panel00 could be re-named IMO
// Unless there's more than 1
frame.add(new Panel00()); frame.setVisible(true);
}
}
0
By simply looking at the code, I believe the main class in the code would be:
public void paintComponent(Graphics g){
which is line 77 ... as for mistakes, I did not notice any when I scanned through.