Java Reference
In-Depth Information
count should be halved. Each time the user clicks on ȒMoreȓ, the count
should be doubled.
΢΢GExercise P18.9. Modify the program of Exercise P18.8 to replace the
buttons with a slider to generate fewer or more random rectangles.
΢΢GExercise P18.10. In the slider test program, add a set of tick marks to
each slider that show the exact slider position.
΢΢΢GExercise P18.11. Enhance the font viewer program to allow the user to
select different fonts. Research the API documentation to find out how
to find the available fonts on the user's system.
Additional programming exercises are available in WileyPLUS.
817
818
PROGRAMMING PROJECTS
΢΢΢GProject 18.1. Write a program that lets users design charts such as the
following:
Use appropriate components to ask for the length, label, and color, then
apply them when the user clicks an ȒAdd Itemȓ button. Allow the user
to switch between bar charts and pie charts.
΢΢΢GProject 18.2. Write a program that displays a scrolling message in a
panel. Use a timer for the scrolling effect. In the timer's action listener,
move the starting position of the message and repaint. When the
message has left the window, reset the starting position to the other
corner. Provide a user interface to customize the message text, font,
foreground and background colors, and the scrolling speed and
direction.
Search WWH ::




Custom Search