当前位置: 首页>>代码示例>>Java>>正文


Java FileDialogPeer.setFile方法代码示例

本文整理汇总了Java中java.awt.peer.FileDialogPeer.setFile方法的典型用法代码示例。如果您正苦于以下问题:Java FileDialogPeer.setFile方法的具体用法?Java FileDialogPeer.setFile怎么用?Java FileDialogPeer.setFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.awt.peer.FileDialogPeer的用法示例。


在下文中一共展示了FileDialogPeer.setFile方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setFile

import java.awt.peer.FileDialogPeer; //导入方法依赖的package包/类
/**
  * Sets the selected file for this dialog.
  *
  * @param file The selected file for this dialog.
  */
public synchronized void
setFile(String file)
{
  if ("".equals(file))
    this.file = null;
  else
    this.file = file;

  if (peer != null)
    {
      FileDialogPeer f = (FileDialogPeer) peer;
      f.setFile (file);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:20,代码来源:FileDialog.java

示例2: setFile

import java.awt.peer.FileDialogPeer; //导入方法依赖的package包/类
/**
  * Sets the selected file for this dialog.
  *
  * @param file The selected file for this dialog.
  */
public synchronized void
setFile(String file)
{
  if ("".equals(file))
    this.file = null;
  else
    this.file = file;
  
  if (peer != null)
    {
      FileDialogPeer f = (FileDialogPeer) peer;
      f.setFile (file);
    }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:20,代码来源:FileDialog.java

示例3: setFile

import java.awt.peer.FileDialogPeer; //导入方法依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:FileDialog.java

示例4: setFile

import java.awt.peer.FileDialogPeer; //导入方法依赖的package包/类
/**
    * 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      java.awt.FileDialog#getFile
    */
   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);
}
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:20,代码来源:FileDialog.java

示例5: setFile

import java.awt.peer.FileDialogPeer; //导入方法依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:21,代码来源:FileDialog.java


注:本文中的java.awt.peer.FileDialogPeer.setFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。