The expression ct.____________________ deletes all of the elements from the container ct.
Fill in the blank(s) with the appropriate word(s).
clear()
You might also like to view...
The IPO chart:
a. Separates the data from the required results from the required processing when identifying the problem. b. Designates the modules in which the individual processing is completed. c. Gives a graphic representation of the solution. d. All of the above.
Enhance the Painter application that you developed to include menus to allow the user to select the size and color of the painted ellipses and the color of the JFrame (Fig. 22.34). (The menus replace the JRadioButtons.) Also, add a multiline JTextArea that allows the user to type text to accompany the painting. The user should be able to use menus to select the font style and color of the text and the background color of the JTextArea.
a) Copying the template to your working directory. Copy the C:Examples Tutorial22ExercisesPainterEnhanced directory to your C:SimplyJava direc- tory.
b) Opening the template file. Open the Painter.java file in your text editor.
c) Creating paintJMenu. In line 75, add the code that will set up paintJMenu. To do this, create a new JMenu and assign it to paintJMenu. Next, set the text of paintJ- Menu to "Paint". Set the mnemonic for paintJMenu to the P key. You will need to use KeyEvent constant VK_P. The, add paintJMenu to painterJMenuBar.
d) Creating textJMenu. Before the code that sets up textColorJMenuItem, add the code that will set up textJMenu. To do this, create a new JMenu and assign it to text- JMenu. Next, set the text of textJMenu to "Text". Set the mnemonic for textJMenu to the T key. You will need to use KeyEvent constant VK_T. Then, add textJMenu to painterJMenuBar.
e) Allowing the user to select the paint color. In the paintColorJMenuItemAction- Performed method, dec