本文整理汇总了Java中java.awt.peer.FileDialogPeer.setDirectory方法的典型用法代码示例。如果您正苦于以下问题:Java FileDialogPeer.setDirectory方法的具体用法?Java FileDialogPeer.setDirectory怎么用?Java FileDialogPeer.setDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.peer.FileDialogPeer
的用法示例。
在下文中一共展示了FileDialogPeer.setDirectory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDirectory
import java.awt.peer.FileDialogPeer; //导入方法依赖的package包/类
/**
* Sets the directory for this file dialog.
*
* @param dir The new directory for this file dialog.
*/
public synchronized void
setDirectory(String dir)
{
this.dir = dir;
if (peer != null)
{
FileDialogPeer f = (FileDialogPeer) peer;
f.setDirectory (dir);
}
}
示例2: setDirectory
import java.awt.peer.FileDialogPeer; //导入方法依赖的package包/类
/**
* Sets the directory of this file dialog window to be the
* specified directory. Specifying a <code>null</code> or an
* invalid directory implies an implementation-defined default.
* This default will not be realized, however, until the user
* has selected a file. Until this point, <code>getDirectory()</code>
* will return the value passed into this method.
* <p>
* Specifying "" as the directory is exactly equivalent to
* specifying <code>null</code> as the directory.
*
* @param dir the specified directory
* @see java.awt.FileDialog#getDirectory
*/
public void setDirectory(String dir) {
this.dir = (dir != null && dir.equals("")) ? null : dir;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setDirectory(this.dir);
}
}
示例3: setDirectory
import java.awt.peer.FileDialogPeer; //导入方法依赖的package包/类
/**
* Sets the directory of this file dialog window to be the
* specified directory. Specifying a {@code null} or an
* invalid directory implies an implementation-defined default.
* This default will not be realized, however, until the user
* has selected a file. Until this point, {@code getDirectory()}
* will return the value passed into this method.
* <p>
* Specifying "" as the directory is exactly equivalent to
* specifying {@code null} as the directory.
*
* @param dir the specified directory
* @see java.awt.FileDialog#getDirectory
*/
public void setDirectory(String dir) {
this.dir = (dir != null && dir.equals("")) ? null : dir;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setDirectory(this.dir);
}
}
示例4: setDirectory
import java.awt.peer.FileDialogPeer; //导入方法依赖的package包/类
/**
* Sets the directory of this file dialog window to be the
* specified directory. Specifying a <code>null</code> or an
* invalid directory implies an implementation-defined default.
* This default will not be realized, however, until the user
* has selected a file. Until this point, <code>getDirectory()</code>
* will return the value passed into this method.
* <p>
* Specifying "" as the directory is exactly equivalent to
* specifying <code>null</code> as the directory.
*
* @param dir the specified directory
* @see java.awt.FileDialog#getDirectory
*/
public void setDirectory(String dir) {
this.dir = (dir != null && dir.equals("")) ? null : dir;
FileDialogPeer peer = (FileDialogPeer)this.peer;
if (peer != null) {
peer.setDirectory(this.dir);
}
}