Constructor and Description |
---|
DrawingPanel(int width,
int height) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Erases all drawn shapes/lines/colors from the panel
|
Graphics2D |
getGraphics()
Obtain the Graphics object to draw on the panel
|
int |
getHeight()
Returns the drawing panel's width in pixels
|
int |
getWidth()
Returns the drawing panel's width in pixels
|
void |
save(String filename)
Saves the current contents of the panel to a file
|
void |
saveAnimated(String filename)
Saves the current contents of the panel and writes them to
a file.
|
void |
setBackground(Color c)
Sets the background color of the drawing panel
|
void |
sleep(int millis)
Makes the program pause for the given amount of time,
allowing for animation
|