Write a Java program that moves a ball in a panel. You need to define a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Java program that moves a ball in a panel. You need to define a panel class for displaying the ball and provide the methods for moving the ball to left, right, up and down when the corresponding buttons are clicked as shown in Appendix 6. Appendix 6. NOSME Left Fight the Down I 16x CREATE YOUR OWN PAINT PROGRAM In this lab, you are expected to work in a team of 2-4 students and develop your own paint program. The basic version of the paint program should allow the user to select from several colors, such as red, blue, and green, and also erase the current paint work, or clear up the whole canvas. *BONUS part 1 (1 points) If you could add an additional button that allows the user to customize the width of the paint brush as well as eraser, you will be eligible for part 1 of BONUS. *BONUS part 2* (1 points) If you can add an additional button that can save what you drew to an image file (such as jpg or gif, etc.), you will be eligible for part 2 of the BONUS. Enjoy programming! The following image shows a sample paint GUI program :) Simple Paint Today a nice day! HAHA <3 is Red Green Blue Eraser Clear 1. Write a GUI program that translates the Latin words to English. The window should have three buttons, one for each Latin word. When the user clicks a button, the program displays the English translation in a label. (sinister = right || dexter = left || medium= center) tk X Write a Java program that moves a ball in a panel. You need to define a panel class for displaying the ball and provide the methods for moving the ball to left, right, up and down when the corresponding buttons are clicked as shown in Appendix 6. Appendix 6. NOSME Left Fight the Down I 16x CREATE YOUR OWN PAINT PROGRAM In this lab, you are expected to work in a team of 2-4 students and develop your own paint program. The basic version of the paint program should allow the user to select from several colors, such as red, blue, and green, and also erase the current paint work, or clear up the whole canvas. *BONUS part 1 (1 points) If you could add an additional button that allows the user to customize the width of the paint brush as well as eraser, you will be eligible for part 1 of BONUS. *BONUS part 2* (1 points) If you can add an additional button that can save what you drew to an image file (such as jpg or gif, etc.), you will be eligible for part 2 of the BONUS. Enjoy programming! The following image shows a sample paint GUI program :) Simple Paint Today a nice day! HAHA <3 is Red Green Blue Eraser Clear 1. Write a GUI program that translates the Latin words to English. The window should have three buttons, one for each Latin word. When the user clicks a button, the program displays the English translation in a label. (sinister = right || dexter = left || medium= center) tk X
Expert Answer:
Answer rating: 100% (QA)
Heres a basic Java program that implements the functionality you described using Swing for the GUI java import javaxswing import javaawt import javaaw... View the full answer
Related Book For
Introduction To Java Programming And Data Structures Comprehensive Version
ISBN: 9780136520238
12th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
Write a Java program that uses the Up, , Down , Right (and possibly Left) arrows of the keyboard (or keypad) to move a ball. (note the Up arrow is called "Up" with ASCII code 38, Down arrow is...
-
Let r and s be solutions to the quadratic equation x 2 b x + c = 0. For n N, define d0 = 0 d1 = r s dn = b dn1 c dn2 (n 2) Prove that dn = r n s n for all n N. [4 marks] (b) Recall that a commutative...
-
The species-area curve tells us that slowing or halting___________ ___________ will potentially slow the rate of extinction.
-
In 2005, using $2.5 million in community property, Quinn creates a trust, life estate to his wife, Eve, and remainder to their children. Quinn dies in 2011 when the trust is worth $3.6 million, and...
-
A mixture of chloroform (CHC13) and acetic acid at 18oC and 1 atm (101.3 kPa) is to be extracted with water to recover the acid.(a) Forty-five kilograms of a mixture containing 35 wt% CHC13 and 65...
-
Write short notes on: (i) Timber, (ii) composite materials, (iii) glass, and (iv) plastics.
-
1. How would you describe Evelyn Gustafsons leadership style? What were its strengths and weaknesses? What were the sources of her influence? 2. How would you describe Erik Rasmussens leadership...
-
Prepare Phillip and Claire's 2022 Federal Tax Return, and fill out the following forms: Form 1040, Schedule 1, Schedule 2, Schedule A, B, C, D, SE, Form 8949, Form 8995 TAXPAYER INFORMATION 1....
-
Which of the following will appear as a line item in the traditional format of an income statement? OA. total fixed costs (manufacturing and non-manufacturing) OB. contribution margin OC. total...
-
Do you feel women are at a disadvantage when starting new companies and looking for financing? What do you think is required for women in these underdeveloped countries to get financing? Can they be...
-
What are some of the pros and cons of shifting elements of the portfolio, including rebalancing or making investment changes in terms of their tax liability? Showing full detail and specific examples...
-
Fitzpatrick Novelties, an edgy producer of sportswear, has been experiencing a period of tremendous growth.Fitzpatrick does not currently pay any dividends, preferring instead to reinvest all...
-
Soit le polynme P(x)= x - 2x2 - 5x+6 1) Calculer: P(-1) et P(3). Conclure ? 2) Effectuer la division Euclidienne de P (x) par x - 3 3) Dduire Q(x) tel que: P(x) = (x-3) Q(x). 4) Montrer que -2 est...
-
On November 12th Bloomberg reported that one euro (EUR) cost 20.1802 Mexican pesos (MXN) and that one Peruvian solas (PEN) cost 5.0592 MXN. (a) Are these exchange rates real or nominal? Briefly...
-
Which of the following is correct for a space X: * If A is closed, then A is not open If A is not closed, then A is open If A is not closed, then X\A is not pen If A is not open, then A is closed If...
-
1. Use these cost, revenue, and probability estimates along with the decision tree to identify the best decision strategy for Trendy's Pies. 2. Suppose that Trendy is concerned about her probability...
-
The Knights Tour is an ancient puzzle. The objective is to move a knight, starting from any square on a chessboard, to every other square once, as shown in Figure 18.15a. Note the knight makes only...
-
Revise Listing 32.10, ParallelMergeSort.java, to define a generic parallelMergeSort method as follows: public static > void parallelMergeSort(E[] list) Data from Listing 32.10, 1mport...
-
Write a program that prompts the user to enter a string and displays the number of the uppercase letters in the string. Enter a string: Welcome to Java The number of uppercase letters is 2
-
Show that for real numbers \(\alpha, \beta\), and \(\delta\) the matrices form a group under matrix multiplication. Show that the matrices \(G\) with \(\alpha=\beta=0\) form an invariant subgroup of...
-
Determine the irrep content for the equivalent reducible \(S_{3}\) representations \(\Gamma^{(4)}\) and \(\Gamma^{(5)}\) of Fig. 2.4 . Data from Fig. 2.4 F(1) (2) 1 (3) (4) r(5) (6) 1 0 0 0 0 0 0 1 0...
-
Prove that the direct product of two representations is a representation, and that the character of the direct product is the product of characters for the representations.
Study smarter with the SolutionInn App