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

24th Apr 2018, 6:04 AM
phani deep
phani deep - avatar
2 Respostas
+ 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); } }
25th Apr 2018, 3:29 PM
Rrestoring faith
Rrestoring faith - avatar
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.
25th Apr 2018, 1:54 PM
Johnathan Campbell
Johnathan Campbell - avatar