Question: The TimerGrow code and its associated driver, Groworiver, given below, create a display window and display in that window a square with NW coner at


The TimerGrow code and its associated driver, Groworiver, given below, create a display window and display in that window a square with NW coner at (0,0) and starting edge side 100. A fully functional Quit button has also been provided with the code (however this button has been disabled in the working version displayed below). public class TimerGrowDriver public static void main(String args DisplayWindow d new DisplayWindow); TimerGrowSquare p-new TimerGrowSquare(); d.addPanel(o); d.showFrame) import java.awt. import javax.swing.; import java, awt event.". // needed for event handling public class TimerGrowSquare extends JPanel implements ActionListener private JButton quit new JButtonQuit"): private Timer clock; private int edge 100; public setPreferredSize(new Dimension(500,500) this.add(quit); quit addActionListener(this); public void paintComponent(Graphics gh super paintComponent(g) g.drawRect 0,0,edge,edge); public void actionPerformed(ActionEvent eX if (e.getSource() = quit) System.exit(0): Quit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
