Java Reference
In-Depth Information
5. Write a complete Java program that creates a window titled “Compose Message” that is 300 by 200 pixels.
6. Write a complete Java program that creates a window titled “Silly String Game” that is 300 by 100 pixels. The user
can type text into the text field. When the user presses a button labeled “Upper case”, the text is capitalized. When
the user presses a button labeled “Lower Case”, the text is made lowercase.
7. Write a complete Java program that creates a window titled “MegaCalc” that is 400 by 300 pixels. In the window,
there are two text fields in which the user types the operands to a binary + operation. When the user presses
the + button, the program treats the text in the two fields as two integers, adds them together, and displays the
resulting integer on the screen as the text of a result label.
8. Write a panel class called EyePanel (and any other classes you need, such as event listeners) to implement a panel
that draws two eyes that look up, to the center, or down depending on whether the mouse cursor is above, inside, or
below the eyes. The following three screenshots show the eyes in each of the three positions:
Search WWH ::




Custom Search