Supporting files: None.
Objectives:
When editing images, particularly small icons, an application for editing individual pixels can be quite useful. Changing an individual memory value is sometimes called poking, hence the name of this assignment: Pixel Poker. The following illustrates how the program should look when it is executed.
Your JFrame's container will use a GridLayout, and each individual element within the grid will be a JPanel. You can set the color of a JPanel by passing a Color object to the setBackground method, and you can access its current color using getBackground. You will want to associate a MouseListener with each JPanel to identify when the user presses the mouse button in the panel.
The completed assignment uses the following classes and interfaces:
Classes | javax.swing | JFrame |
javax.swing | JPanel | |
java.awt | Container | |
java.awt | GridLayout | |
java.awt | Color | |
java.awt.event | MouseEvent | |
Interfaces | java.awt.event | MouseListener |