public class FileDialog extends Dialog
FileDialog クラスは、ユーザーがファイルを選択できるダイアログウィンドウを表示します。
このダイアログはモーダルであるため、アプリケーションがその show メソッドを呼び出してこのダイアログを表示すると、ユーザーがファイルを選択するまでアプリケーションのほかの部分は使用できません。
Window.show(), 直列化された形式Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeWindow.AccessibleAWTWindow, Window.TypeContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| 修飾子と型 | フィールドと説明 |
|---|---|
static int |
LOAD
この定数値は、ファイルダイアログウィンドウの目的が読み込み用ファイルの検索であることを示します。
|
static int |
SAVE
この定数値は、ファイルダイアログウィンドウの目的が書き込み用ファイルの検索であることを示します。
|
DEFAULT_MODALITY_TYPEBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| コンストラクタと説明 |
|---|
FileDialog(Dialog parent)
ファイルをロードするためのファイルダイアログを生成します。
|
FileDialog(Dialog parent, String title)
指定されたタイトルを使用して、ファイルをロードするためのファイルダイアログウィンドウを生成します。
|
FileDialog(Dialog parent, String title, int mode)
指定されたタイトルを使用して、ファイルをロードまたは保存するためのファイルダイアログウィンドウを生成します。
|
FileDialog(Frame parent)
ファイルをロードするためのファイルダイアログを生成します。
|
FileDialog(Frame parent, String title)
指定されたタイトルを使用して、ファイルをロードするためのファイルダイアログウィンドウを生成します。
|
FileDialog(Frame parent, String title, int mode)
指定されたタイトルを使用して、ファイルをロードまたは保存するためのファイルダイアログウィンドウを生成します。
|
| 修飾子と型 | メソッドと説明 |
|---|---|
void |
addNotify()
ファイルダイアログのピアを作成します。
|
String |
getDirectory()
このファイルダイアログのディレクトリを取得します。
|
String |
getFile()
このファイルダイアログの選択されているファイルを取得します。
|
FilenameFilter |
getFilenameFilter()
このファイルダイアログのファイル名フィルタを調べます。
|
File[] |
getFiles()
ユーザーが選択するファイルを返します。
|
int |
getMode()
このファイルダイアログボックスがファイルからロードするためのものか、ファイルに保存するためのものかを示します。
|
boolean |
isMultipleMode()
ファイルダイアログで複数ファイル選択が許可されるかどうかを返します。
|
protected String |
paramString()
この
FileDialog ウィンドウの状態を表す文字列表現を返します。 |
void |
setDirectory(String dir)
このファイルダイアログウィンドウのディレクトリを指定されたディレクトリに設定します。
|
void |
setFile(String file)
このファイルダイアログウィンドウの選択されているファイルを、指定されたファイルに設定します。
|
void |
setFilenameFilter(FilenameFilter filter)
ファイルダイアログウィンドウのファイル名フィルタを指定されたフィルタに設定します。
|
void |
setMode(int mode)
ファイルダイアログのモードを設定します。
|
void |
setMultipleMode(boolean enable)
ファイルダイアログでの複数ファイル選択を有効または無効にします。
|
getAccessibleContext, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBackaddPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFrontadd, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final int LOAD
public static final int SAVE
public FileDialog(Frame parent)
FileDialog(parent, "", LOAD) の簡易メソッドです。parent - ダイアログの所有者public FileDialog(Frame parent, String title)
FileDialog(parent, title, LOAD) の簡易メソッドです。parent - ダイアログの所有者title - ダイアログのタイトルpublic FileDialog(Frame parent, String title, int mode)
mode の値が LOAD である場合、ファイルダイアログは読み取るファイルを検索し、表示されるファイルは現在のディレクトリ内のファイルです。mode の値が SAVE である場合、ファイルダイアログはファイルを書き込む場所を検索します。
parent - ダイアログの所有者title - ダイアログのタイトルmode - ダイアログのモードであり、FileDialog.LOAD または FileDialog.SAVE のどちらかIllegalArgumentException - 不正なファイルダイアログのモードが指定された場合LOAD, SAVEpublic FileDialog(Dialog parent)
FileDialog(parent, "", LOAD) の簡易メソッドです。parent - ダイアログの所有者IllegalArgumentException - parent の GraphicsConfiguration が画面デバイスのものでない場合IllegalArgumentException - parent が null である場合。GraphicsEnvironment.isHeadless が true を返した場合は、この例外が常にスローされるGraphicsEnvironment.isHeadless()public FileDialog(Dialog parent, String title)
FileDialog(parent, title, LOAD) の簡易メソッドです。parent - ダイアログの所有者title - ダイアログのタイトル。null 値は、NullPointerException がスローされることなく受け入れられるIllegalArgumentException - parent の GraphicsConfiguration が画面デバイスのものでない場合IllegalArgumentException - parent が null である場合。GraphicsEnvironment.isHeadless が true を返した場合は、この例外が常にスローされるGraphicsEnvironment.isHeadless()public FileDialog(Dialog parent, String title, int mode)
mode の値が LOAD である場合、ファイルダイアログは読み取るファイルを検索し、表示されるファイルは現在のディレクトリ内のファイルです。mode の値が SAVE である場合、ファイルダイアログはファイルを書き込む場所を検索します。
parent - ダイアログの所有者title - ダイアログのタイトル。null 値は、NullPointerException がスローされることなく受け入れられるmode - ダイアログのモードであり、FileDialog.LOAD または FileDialog.SAVE のどちらかIllegalArgumentException - 不正なファイルダイアログのモードが指定された場合IllegalArgumentException - parent の GraphicsConfiguration が画面デバイスのものでない場合IllegalArgumentException - parent が null である場合。GraphicsEnvironment.isHeadless が true を返した場合は、この例外が常にスローされるGraphicsEnvironment.isHeadless(), LOAD, SAVEpublic void addNotify()
addNotify、クラス: DialogComponent.isDisplayable(), Window.removeNotify()public int getMode()
FileDialog.LOAD または FileDialog.SAVELOAD, SAVE, setMode(int)public void setMode(int mode)
mode が不当な値の場合は例外がスローされ、mode は設定されません。mode - このファイルダイアログのモード。FileDialog.LOAD または FileDialog.SAVEIllegalArgumentException - 不正なファイルダイアログのモードが指定された場合LOAD, SAVE, getMode()public String getDirectory()
FileDialog のディレクトリ。null の場合や無効なディレクトリの場合もあるsetDirectory(java.lang.String)public void setDirectory(String dir)
null または無効なディレクトリを指定すると、実装で定義されているデフォルトに設定されます。ただし、このデフォルトはユーザーがファイルを選択したときに設定されます。 そのときまでは、getDirectory() はこのメソッドに渡された値を返します。
ディレクトリとして "" を指定すると、null に設定されます。
dir - 指定されたディレクトリgetDirectory()public String getFile()
CANCEL を選択すると null が返されます。nullsetFile(java.lang.String)public File[] getFiles()
ユーザーがファイルダイアログを取り消した場合、このメソッドは空の配列を返します。
setFile(String), getFile()public void setFile(String file)
ファイルとして "" を指定すると、null に設定されます。
file - 設定されるファイルgetFile(), getFiles()public void setMultipleMode(boolean enable)
enable - true の場合は複数ファイル選択が有効、false の場合は無効。isMultipleMode()public boolean isMultipleMode()
true、そうでない場合は false。setMultipleMode(boolean)public FilenameFilter getFilenameFilter()
FilenameFilter, setFilenameFilter(java.io.FilenameFilter)public void setFilenameFilter(FilenameFilter filter)
filter - 指定されたフィルタFilenameFilter, getFilenameFilter()protected String paramString()
FileDialog ウィンドウの状態を表す文字列表現を返します。このメソッドはデバッグ専用であり、返される文字列の内容および形式は実装によって異なります。返される文字列は空の場合がありますが、null にはなりません。paramString、クラス: Dialog バグまたは機能を送信
詳細な API リファレンスおよび開発者ドキュメントについては、Java SE のドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.