write my assignment 9424

13.6 (Drawing Cubes) Write an application that draws a cube. Use class GeneralPath and method draw of class Graphics2D.

Ex 13.19 (Screen Saver Using Timer) Package javax.swing contains a class called Timer that is capable of calling method actionPerformed of interface ActionListener at a fixed time interval (specified in milliseconds). Modify your solution to Exercise 13.18 to remove the call to repaint from method paintComponent. Declare your class to implement ActionListener. (The actionPerformed method should simply call repaint.) Declare an instance variable of type Timer called timer in your class. In the constructor for your class, write the following statements:

timer = new Timer(1000, this);

timer.start();

This creates an instance of class Timer that will call this object’s actionPerformed method every 1000 milliseconds (i.e., every second).

CIS 043 Midterm Exam I – Programming Problems – Solution attached as files

 
"Not answered?"
Get the Answer