Answered You can buy a ready-made answer or pick a professional tutor to order an original one.

QUESTION

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

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

Show more
  • @
  • 22 orders completed
ANSWER

Tutor has posted answer for $10.00. See answer's preview

$10.00

*** ******** ****** ***** ** application **** ***** * **** Use ***** *********** and method draw ** class *************************** *********** ************************* ***** ******** extends ****** *** ****** static **** main(String[] args) *** JFrame ***** = *** *************** *********************************************** ************ application * *** *************** ********************** framesetSize(300 ***** ************************ }} CubeDesigner ************ ******************* ********************** javaawtGraphics2D;import javaawtgeomGeneralPath;import javaxswingJPanel;public ***** ************ ******* ****** * public **** ************** g) * ************** *** base1X[] * * *** 100 200 200 *** }; *** base1Y[] * { *** *** 200 *** *** ** int ******** = * ** ** 175 *** ** ** int ******** * * ** 175 *** ** 75 }; ********** *** * (Graphics2D) ** g2DsetColor(Colorred); *********** **** * new GeneralPath(); *** **** i * ** i ***** ** i++) { ******************* * ** base1Y[i * 1]); ******************** base1Y[i]); cubemoveTo(base2X[i * 1] base2Y[i * **** ******************** *********** ******************** *********** ******************** *********** } ************** ************* **** ******* Saver Using Timer) Package javaxswing ******** * ***** called ***** **** ** capable of ******* ****** *************** ** ********* ActionListener ** * ***** **** ******** ********** ** ************* ****** **** ******** ** ******** **** to remove *** call to repaint **** ****** ************** ******* **** class ** ********* ************** **** actionPerformed ****** ****** ****** **** ******** ******* an ******** ******** ** **** ***** called timer in your ***** ** *** *********** *** **** ***** write *** ********* statements:timer = new ********** *********************** ******* an instance ** class ***** that will **** **** ********** *************** method ***** **** ************ *** every **************************** javaawtColor;import ********************** ****************************** javaawteventActionListener; import *********************** ************************ ***** *********** ******* ****** ********** ActionListener *** ******* ***** ******** public ScreenSaver() { ********************* ***** * *** ********** this); ************* *********** ***** ***************** *** public ****** **** ************* ***** * ScreenSaver *********** * *** ************** ********************************************************* *** public **** paint(Graphics g) { ************** int * y ** ***** for **** * * ** * ***** 4; **** * x * ***** ************* * ***** * * ***** ************* * 300); ** * (int) ************* * 300); ** * ***** (Mathrandom() * ***** gsetColor(new ************* ************ ******* ************ (float) *************** *********** * ** **** * *** ********* ****** **** actionPerformed(ActionEvent ** * ********** *******************

Click here to download attached files: Chapter 13_ProgrammingAssignment.docx
Click here to download attached files: CIS 043 Midterm Exam I - Programming Problems.docx
or Buy custom answer
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question