All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.ImagePreview

java.lang.Object
   |
   +----java.awt.Component
           |
           +----com.sun.java.swing.ImagePreview

public class ImagePreview
extends Component
implements FilePreview
A component to preview an image file, intended to fit into the preview slot of a FileChooser. In normal usage, only the ask method is of interest: it pops up a dialog box with a FileChooser containing an instance of this previewer and filtering for appropriate files.


Constructor Index

 o ImagePreview()

Method Index

 o ask(JFrame, String, File, ChangeListener)
Convenience method to prompt for the name of an image file.
 o getMinimumSize()
 o getPreferredSize()
 o imageUpdate(Image, int, int, int, int, int)
 o paint(Graphics)
 o setPreviewFile(File)

Constructors

 o ImagePreview
 public ImagePreview()

Methods

 o ask
 public static File ask(JFrame parent,
                        String title,
                        File dfc,
                        ChangeListener target)
Convenience method to prompt for the name of an image file.

Parameters:
fparent - the parent frame for the dialog box. fparent may be null if a default parent has been established with StandardDialog
description - a description string that will be shown to the user to indicate what is being requested
initial - the initial value for the string
columns - the default width (in 'm's) of the TextField
target - the ChangeListener that will be informed if the OK or Apply buttons are hit.
Returns:
If target is null, the dialog box will be modal and the method will return the final result, or null if cancelled. Otherwise, the dialog box is non-modal, the method returns null immediatly, and the listener is informed when appropriate. The source of the change event will be a FileChooser.
See Also:
StandardDialog
 o setPreviewFile
 public void setPreviewFile(File f)
 o getPreferredSize
 public Dimension getPreferredSize()
Overrides:
getPreferredSize in class Component
 o getMinimumSize
 public Dimension getMinimumSize()
Overrides:
getMinimumSize in class Component
 o imageUpdate
 public synchronized boolean imageUpdate(Image img,
                                         int infoflags,
                                         int x,
                                         int y,
                                         int width,
                                         int height)
Overrides:
imageUpdate in class Component
 o paint
 public void paint(Graphics g)
Overrides:
paint in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index