Java プラットフォーム 1.2

java.awt
クラス FileDialog

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Dialog
                          |
                          +--java.awt.FileDialog

public class FileDialog
extends Dialog

FileDialog クラスは、ユーザがファイルを選択できるダイアログウィンドウを表示します。

このダイアログはモーダルであるため、アプリケーションがその show メソッドを呼び出してこのダイアログを表示すると、ユーザがファイルを選択するまでアプリケーションのほかの部分はブロックされます。

導入されたバージョン:
JDK1.0
関連項目:
Window.show(), 直列化された形式

フィールドの概要
static int LOAD
          この定数値は、ファイルダイアログウィンドウの目的が読み込み元ファイルの検索であることを示します。
static int SAVE
          この定数値は、ファイルダイアログウィンドウの目的が書き込み先ファイルの検索であることを示します。
 
クラス java.awt.Component から継承したフィールド
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
コンストラクタの概要
FileDialog(Frame parent)
          ファイルをロードするためのファイルダイアログを作成します。
FileDialog(Frame parent, String title)
          ファイルをロードするためのファイルダイアログウィンドウを、タイトルを指定して作成します。
FileDialog(Frame parent, String title, int mode)
          ファイルをロードまたは保存するためのファイルダイアログウィンドウを、タイトルを指定して作成します。
 
メソッドの概要
 void addNotify()
          ファイルダイアログのピアを作成します。
 String getDirectory()
          このファイルダイアログのディレクトリを取得します。
 String getFile()
          このファイルダイアログの選択されているファイルを取得します。
 FilenameFilter getFilenameFilter()
          このファイルダイアログのファイル名フィルタを調べます。
 int getMode()
          このファイルダイアログボックスがファイルからロードするためのものか、ファイルに保存するためのものかを示します。
protected  String paramString()
          このファイルダイアログウィンドウの状態を表すパラメータ文字列を返します。
 void setDirectory(String dir)
          このファイルダイアログウィンドウのディレクトリを、指定されたディレクトリに設定します。
 void setFile(String file)
          このファイルダイアログウィンドウの選択されているファイルを、指定されたファイルに設定します。
 void setFilenameFilter(FilenameFilter filter)
          このファイルダイアログウィンドウのファイル名フィルタを、指定されたフィルタに設定します。
 void setMode(int mode)
          ファイルダイアログのモードを設定します。
 
クラス java.awt.Dialog から継承したメソッド
getTitle, isModal, isResizable, setModal, setResizable, setTitle, show
 
クラス java.awt.Window から継承したメソッド
addWindowListener, applyResourceBundle, applyResourceBundle, dispose, finalize, getFocusOwner, getInputContext, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isShowing, pack, postEvent, processEvent, processWindowEvent, removeWindowListener, toBack, toFront
 
クラス java.awt.Container から継承したメソッド
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate, validateTree
 
クラス java.awt.Component から継承したメソッド
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
クラス java.lang.Object から継承したメソッド
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

LOAD

public static final int LOAD
この定数値は、ファイルダイアログウィンドウの目的が読み込み元ファイルの検索であることを示します。

SAVE

public static final int SAVE
この定数値は、ファイルダイアログウィンドウの目的が書き込み先ファイルの検索であることを示します。
コンストラクタの詳細

FileDialog

public FileDialog(Frame parent)
ファイルをロードするためのファイルダイアログを作成します。ファイルダイアログのタイトルは、最初は空です。
パラメータ:
parent - ダイアログのオーナ
導入されたバージョン:
JDK1.1

FileDialog

public FileDialog(Frame parent,
                  String title)
ファイルをロードするためのファイルダイアログウィンドウを、タイトルを指定して作成します。表示されるファイルは、現在のディレクトリのファイルです。
パラメータ:
parent - ダイアログのオーナ
title - ダイアログのタイトル

FileDialog

public FileDialog(Frame parent,
                  String title,
                  int mode)
ファイルをロードまたは保存するためのファイルダイアログウィンドウを、タイトルを指定して作成します。

mode の値が LOAD の場合、ファイルダイアログは読み込み元のファイルを検索します。mode の値が SAVE の場合、ファイルダイアログはファイルの書き込み先を検索します。

パラメータ:
parent - ダイアログのオーナ
title - ダイアログのタイトル
mode - ダイアログのモード
関連項目:
LOAD, SAVE
メソッドの詳細

addNotify

public void addNotify()
ファイルダイアログのピアを作成します。ピアは、ファイルダイアログの機能を変更せずに、その外観を変更することを可能にします。
オーバーライド:
クラス Dialog 内の addNotify

getMode

public int getMode()
このファイルダイアログボックスがファイルからロードするためのものか、ファイルに保存するためのものかを示します。
戻り値:
このファイルダイアログウィンドウのモード。FileDialog.LOAD または FileDialog.SAVE
関連項目:
LOAD, SAVE, setMode(int)

setMode

public void setMode(int mode)
ファイルダイアログのモードを設定します。
パラメータ:
mode - このファイルダイアログのモード。FileDialog.LOAD または FileDialog.SAVE
例外:
IllegalArgumentException - ファイルダイアログのモードが無効な場合
導入されたバージョン:
JDK1.1
関連項目:
LOAD, SAVE, getMode()

getDirectory

public String getDirectory()
このファイルダイアログのディレクトリを取得します。
戻り値:
この FileDialog のディレクトリ。null の場合や無効なディレクトリの場合もある
関連項目:
setDirectory(java.lang.String)

setDirectory

public void setDirectory(String dir)
このファイルダイアログウィンドウのディレクトリを、指定されたディレクトリに設定します。null または無効なディレクトリを指定すると、システムで定義されているデフォルトに設定されます。ただし、このデフォルトはユーザがファイルを選択するまで実現されません。そのときまでは、getDirectory() はこのメソッドに渡された値を返します。

ディレクトリとして "" を指定すると、null に設定されます。

パラメータ:
dir - 特定のディレクトリ
関連項目:
getDirectory()

getFile

public String getFile()
このファイルダイアログの選択されているファイルを取得します。
戻り値:
このファイルダイアログウィンドウの現在選択されているファイル。ファイルが選択されていない場合は null
関連項目:
setFile(java.lang.String)

setFile

public void setFile(String file)
このファイルダイアログウィンドウの選択されているファイルを、指定されたファイルに設定します。このファイルは、ファイルダイアログウィンドウが最初に表示される前に設定されている場合はデフォルトファイルになります。

ファイルとして "" を指定すると、null に設定されます。

パラメータ:
file - 設定されるファイル
関連項目:
getFile()

getFilenameFilter

public FilenameFilter getFilenameFilter()
このファイルダイアログのファイル名フィルタを調べます。ファイル名フィルタを使用すると、ユーザはファイルダイアログに表示されるファイルを指定できます。
戻り値:
このファイルダイアログのファイル名フィルタ
関連項目:
FilenameFilter, setFilenameFilter(java.io.FilenameFilter)

setFilenameFilter

public void setFilenameFilter(FilenameFilter filter)
このファイルダイアログウィンドウのファイル名フィルタを、指定されたフィルタに設定します。
パラメータ:
filter - 指定されたフィルタ
関連項目:
FilenameFilter, getFilenameFilter()

paramString

protected String paramString()
このファイルダイアログウィンドウの状態を表すパラメータ文字列を返します。
戻り値:
このファイルダイアログウィンドウのパラメータ文字列
オーバーライド:
クラス Dialog 内の paramString

Java プラットフォーム 1.2

バグや機能要求の報告
新しい javadoc の表示についてのコメントやご提案
Java は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.