Question: write a comment for each line of the following code public class Main { public static void main(String[] args) { JFrame frame = new JFrame(game);
write a comment for each line of the following code
public class Main { public static void main(String[] args) { JFrame frame = new JFrame("game"); JFrame startScreen = new JFrame(); JButton start = new JButton("Click here to Start Play"); destroyBlocks panel = new destroyBlocks(frame,startScreen); start.addActionListener(listener -> { startScreen.setVisible(false); frame.setVisible(true); }); frame.getContentPane().add(panel); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(false); frame.setSize(490, 600); frame.setResizable(false); startScreen.getContentPane().add(start); startScreen.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); startScreen.setVisible(true); startScreen.setSize(490, 600); startScreen.setResizable(false); }
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
