public class PictureFrame
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) javax.swing.JFrame |
frame
Main window used as the frame
|
(package private) javax.swing.ImageIcon |
imageIcon
ImageIcon used to display the picture in the label
|
private javax.swing.JLabel |
label
Label used to display the picture
|
private DigitalPicture |
picture
Digital Picture to display
|
Constructor and Description |
---|
PictureFrame()
A constructor that takes no arguments.
|
PictureFrame(DigitalPicture picture)
A constructor that takes a picture to display
|
Modifier and Type | Method and Description |
---|---|
void |
close()
A method to close a picture frame
|
void |
displayImage()
A method to make sure the frame is displayed
|
void |
hide()
A method to hide the frame
|
private void |
initFrame()
A method to initialize the picture frame
|
void |
repaint()
Method to force the picture frame to repaint (redraw)
|
void |
setPicture(Picture picture)
Method to set the picture to show in this picture frame
|
void |
setTitle(java.lang.String title)
Method to set the title for the picture frame
|
void |
setVisible(boolean flag)
A method to set the visible flag on the frame
|
void |
updateImage()
A method to update the picture frame image with the image
in the picture
|
void |
updateImageAndShowIt()
A method to update the picture frame image with the image in
the picture and show it
|
javax.swing.JFrame frame
javax.swing.ImageIcon imageIcon
private javax.swing.JLabel label
private DigitalPicture picture
public PictureFrame()
public PictureFrame(DigitalPicture picture)
picture
- the digital picture to display in the
picture framepublic void setPicture(Picture picture)
picture
- the new picture to usepublic void updateImage()
public void updateImageAndShowIt()
public void displayImage()
public void hide()
public void setVisible(boolean flag)
flag
- the flag to usepublic void close()
public void setTitle(java.lang.String title)
title
- the title to usepublic void repaint()
private void initFrame()