下面列出了java.awt.peer.FileDialogPeer#setFile ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.isEmpty()) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* <code>null</code>
* as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}
/**
* Sets the selected file for this file dialog window to be the
* specified file. This file becomes the default file if it is set
* before the file dialog window is first shown.
* <p>
* When the dialog is shown, the specified file is selected. The kind of
* selection depends on the file existence, the dialog type, and the native
* platform. E.g., the file could be highlighted in the file list, or a
* file name editbox could be populated with the file name.
* <p>
* This method accepts either a full file path, or a file name with an
* extension if used together with the {@code setDirectory} method.
* <p>
* Specifying "" as the file is exactly equivalent to specifying
* {@code null} as the file.
*
* @param file the file being set
* @see #getFile
* @see #getFiles
*/
public void setFile(String file) {
this.file = (file != null && file.equals("")) ? null : file;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setFile(this.file);
}
}