previous |
start |
next
Using Inheritance to Customize Frames
- Use separate test class
public class RectangleTest
{
public static void main(String[] args)
{
construct and display frame
}
}
- Frame handlers (e.g. buttons, menus) call methods to
communicate changes to panel
class RectanglePanel extends Panel
{
. . .
public void setLocation(int x, int y)
{
box.setLocation(x, y);
repaint();
}
}
previous |
start |
next