Question: HELP ME DRAW A CONTROL FLOW DIAGRAM FOR THIS CODE, MAKE SURE THE CONTROL FLOW DIAGRAM IS SIMILAR TO THE PICTURE THAT I WILL UPLOAD

HELP ME DRAW A CONTROL FLOW DIAGRAM FOR THIS CODE, MAKE SURE THE CONTROL FLOW DIAGRAM IS SIMILAR TO THE PICTURE THAT I WILL UPLOAD public MainScreen(){
buttonPanel = new MainScreenPanel();
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(320,127,600,400);
setResizable(false);
buttonPanel.setBackground(Color.BLACK);
for (int i =0; i levels.length; i++){
levels[i]= new JRadioButton(levelStrings[i]);
levels[i].addActionListener(this);
levels[i].setBackground(Color.YELLOW);
levels[i].setBounds(260,200+ i *50,80,30);
buttonPanel.add(levels[i]);
}
buttonPanel.setLayout(null);
getContentPane().add(buttonPanel);
setVisible(true);
}
public void actionPerformed(ActionEvent e){
Object obj = e.getSource();
if (obj == levels[0]){
new GameBoardWindow(1);
setVisible(false);
dispose();
}
if (obj == levels[1]){
new GameBoardWindow(2);
setVisible(false);
dispose();
}
if (obj == levels[2]){
new GameBoardWindow(3);
setVisible(false);
dispose();
}
}
@SuppressWarnings("serial")
class MainScreenPanel extends JPanel {
MainScreenPanel(){
}
public void paintComponent(Graphics g){
super.paintComponent(g);
Graphics2D g2=(Graphics2D) g;
g2.setColor(Color.RED);
g2.setFont(new Font("Comic Sans MS", Font.BOLD, 45));
g2.drawString("Snake2D Game", 135,85);
g2.setColor(Color.ORANGE);
g2.drawString("mtala3t",210,150);
}
}
}
HELP ME DRAW A CONTROL FLOW DIAGRAM FOR THIS

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!