borland Packages  Class Hierarchy  jbcl.control Package  Index 

Filer component

java.lang.Object
   +----borland.jbcl.control.Filer

About the Filer component

Variables  Constructors  Properties  Methods  

Implements WindowListener, Serializable, EventListener

The Filer component display an Open or Save As dialog box for opening or saving files. The dialog box displays a list of directories and files the user can use to select a file to open or save. The value of the mode property determines whether the dialog box is an Open or Save As dialog box.

The value of the directory property determines which directory is displayed in the dialog box. If the file property has a specified value, that specified file is the selected file in the dialog box, and when the user selects a file in the dialog box, that file becomes the value of the file property.

The value of the filenameFilter specifies the filter this dialog box displays. filenameFilter is of type FilenameFilter, which is an interface. You must create a class that implements this interface to provide a filter for the dialog box.

You can make the Filer component appear at design time:

  1. Drop the StringInput component on the UI Designer or on the Component Tree.
  2. Set whatever properties you want in the Component Inspector.
  3. Set the frame property to this in the Component Inspector.
  4. Set the visible property to true.

To display the dialog box at runtime, call the show() method or set the visible property to true.


Filer variables

Variables implemented in this class

Filer constructors

Filer properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

Filer methods

Methods implemented in this class

Methods implemented in java.lang.Object


Filer variables

dialog

  protected FileDialog dialog

dir

  protected String dir

file

  protected String file

filter

  protected transient FilenameFilter filter

frame

  protected Frame frame

LOAD

  public static final int LOAD = FileDialog.LOAD

mode

  protected int mode

SAVE

  public static final int SAVE = FileDialog.SAVE

title

  protected String title

Filer constructors

Filer()

  public Filer()

Constructs a File Open dialog box with no title-bar text.

Filer(java.awt.Frame)

  public Filer(java.awt.Frame frame)

Constructs a File Open dialog box with the specified parent frame and no title-bar text.

Parameters:

frame
The parent frame of the dialog box.

Filer(java.awt.Frame, java.lang.String)

  public Filer(java.awt.Frame frame, java.lang.String title)

Constructs an Open or Save As dialog box with the specified parent frame and title-bar text.

Parameters:

frame
The parent frame of the dialog box.
title
The title bar text of the dialog box.

Filer(java.awt.Frame, java.lang.String, int)

  public Filer(java.awt.Frame frame, java.lang.String title, int mode)

Constructs a File Open or File Save dialog box with specified frame, title, and mode.

Parameters:

frame
The parent frame of the dialog box.
title
The title-bar text of the dialog box.
mode
Can be LOAD (for a File Open dialog box) or SAVE (for a File Save dialog box).

Filer properties

directory

 public String getDirectory()
 public void setDirectory(java.lang.String dir)

Specifies the path and directory name selected in the dialog box.

file

 public String getFile()
 public void setFile(java.lang.String file)

Determines the selected file in the dialog box.

filenameFilter

 public FilenameFilter getFilenameFilter()
 public void setFilenameFilter(java.io.FilenameFilter filter)

For the Show Files Of Type drop-down list. Returns or sets the filter for this dialog to the specified filter. FilenameFilter is an interface. To set a filter for the Filer dialog box, you must create a class that implements FilenameFilter. This interface includes an accept() method that returns a boolean value indicating whether a particular file meets the filtering specifications laid out in accept(). For example, accept() might return true if a file has this an .html extension.

frame

 public Frame getFrame()
 public void setFrame(java.awt.Frame frame)

The parent frame of the dialog box.

mode

 public int getMode()
 public void setMode(int m)

Can be LOAD (for a File Open dialog box) or SAVE (for a File Save dialog box).

title

 public String getTitle()
 public void setTitle(java.lang.String title)

The title-bar text of the dialog box.

visible

 public boolean isVisible()
 public void setVisible(boolean visible)

Specifies whether the dialog box visible or not.


Filer methods

show()

  public void show()

Displays the dialog box using java.awt.Dialog.show().