Question: Help me draw a flowgraph for this code / * package com.mtala 3 t . snake 2 d; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import
Help me draw a flowgraph for this code
package com.mtala
t
snake
d;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics
D;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
@author Mohammed.Talaat
mtala
t
@version
public class MainScreen extends JFrame implements ActionListener
private static final long serialVersionUID
L;
JRadioButton levels
new JRadioButton
;
String levelStrings
Easy "Normal", "Hard"
;
MainScreenPanel buttonPanel
null;
public MainScreen
buttonPanel
new MainScreenPanel
;
setDefaultCloseOperation
JFrame
EXIT
ON
CLOSE
;
setBounds
;
setResizable
false
;
buttonPanel.setBackground
Color
BLACK
;
for
int i
; i
levelslength; i
levels
i
new JRadioButton
levelStrings
i
;
levels
i
addActionListener
this
;
levels
i
setBackground
Color
YELLOW
;
levels
i
setBounds
i
;
buttonPanel.add
levels
i
;
buttonPanel.setLayout
null
;
getContentPane
add
buttonPanel
;
setVisible
true
;
public void actionPerformed
ActionEvent e
Object obj
e
getSource
;
if
obj
levels
new GameBoardWindow
;
setVisible
false
;
dispose
;
if
obj
levels
new GameBoardWindow
;
setVisible
false
;
dispose
;
if
obj
levels
new GameBoardWindow
;
setVisible
false
;
dispose
;
@SuppressWarnings
serial
class MainScreenPanel extends JPanel
MainScreenPanel
public void paintComponent
Graphics g
super.paintComponent
g
;
Graphics
D g
Graphics
D
g;
g
setColor
Color
RED
;
g
setFont
new Font
Comic Sans MS
FontBOLD,
;
g
drawString
Snake
D Game",
;
g
setColor
Color
ORANGE
;
g
drawString
mtala
t
;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
