JavaTM 2 Platform
Std. Ed. v1.3

java.awt
クラス FileDialog

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Dialog
                          |
                          +--java.awt.FileDialog
すべての実装インタフェース:
Accessible, ImageObserver, MenuContainer, Serializable

public class FileDialog
extends Dialog

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

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

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

クラス java.awt.Dialog から継承した内部クラス
Dialog.AccessibleAWTDialog
 
クラス java.awt.Window から継承した内部クラス
Window.AccessibleAWTWindow
 
クラス java.awt.Container から継承した内部クラス
Container.AccessibleAWTContainer
 
クラス java.awt.Component から継承した内部クラス
Component.AccessibleAWTComponent
 
フィールドの概要
static int LOAD
          この定数値は、ファイルダイアログウィンドウの目的が読み込み元ファイルの検索であることを示します。
static int SAVE
          この定数値は、ファイルダイアログウィンドウの目的が書き込み先ファイルの検索であることを示します。
 
クラス java.awt.Component から継承したフィールド
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
インタフェース java.awt.image.ImageObserver から継承したフィールド
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
コンストラクタの概要
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 から継承したメソッド
dispose, getAccessibleContext, getTitle, hide, isModal, isResizable, setModal, setResizable, setTitle, show
 
クラス java.awt.Window から継承したメソッド
addWindowListener, applyResourceBundle, applyResourceBundle, finalize, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isShowing, pack, postEvent, processEvent, processWindowEvent, removeWindowListener, setCursor, 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, addHierarchyBoundsListener, addHierarchyListener, 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, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, 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
クラス java.awt.Dialog からコピーされたタグ:
関連項目:
Component.isDisplayable(), Container.removeNotify()

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()
このファイルダイアログのファイル名フィルタを調べます。ファイル名フィルタを使用すると、ユーザはファイルダイアログに表示されるファイルを指定できます。ファイル名フィルタは、Windows 95, 98, or NT 4.0 用の Sun の参照実装では機能しません。
戻り値:
このファイルダイアログのファイル名フィルタ
関連項目:
FilenameFilter, setFilenameFilter(java.io.FilenameFilter)

setFilenameFilter

public void setFilenameFilter(FilenameFilter filter)
ファイルダイアログウィンドウのファイル名フィルタを指定されたフィルタに設定します。ファイル名フィルタは、Windows 95, 98, or NT 4.0 用の Sun の参照実装では機能しません。
パラメータ:
filter - 指定されたフィルタ
関連項目:
FilenameFilter, getFilenameFilter()

paramString

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

JavaTM 2 Platform
Std. Ed. v1.3

バグや機能要求の報告
さらに詳しい API リファレンスおよび開発者ドキュメントについては、 Java 2 SDK SE Developer Documentation を参照してください。このドキュメントには、概念、用語の定義、回避策、 実用的なコード例など、開発者を対象にした詳細な解説が掲載されています。

Java、Java 2D、JDBC は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.