⑴ java 文件选择器 左上角的小图标 要怎么改成自己的图片,默认是JAVA的图标。我用了改JFrame的图标的句
Get the instance of JFrame, set image icon for the JFrame, then just by passing this JFrame to filechooser component the Icon would get reflected for JFileChooser also.
JFileChooser chooser = new JFileChooser();
chooser.showOpenDialog(frm);
中文意思,是把调用的主窗口的图标,先修改,再给JFileChooser。。。。。。。。。
⑵ java 编程FileDialog 一些简单的运用实例代码
去网上找一个中文的api,在java.awt.FileDialog包里,自己看吧,不懂再问我
⑶ java中FileDialog的用法
先实例化,然后name.showdialog();ok
⑷ java的FileDialog组件如何出现的页面的最前面
你可以试试 JFileChhooser组件
JFileChooser jFileChooser = new JFileChooser();
int i = jFileChooser.showOpenDialog(null);
if(i== jFileChooser.APPROVE_OPTION){ //打开文件
String path = jFileChooser.getSelectedFile().getAbsolutePath();
String name = jFileChooser.getSelectedFile().getName();
System.out.println("当前文件路径:"+path+";\n当前文件名:"+name);
}else{
System.out.println("没有选中文件");
}
⑸ java开发中,FileDialog.show()显示提示框,请问设置打开时的名称不能修改
这是文件浏览选择对话框。可以改,但必须是改过以后文件名。否则,开始上传时,会找不到文件。
这样好吗?其实,这里不仅仅是一个文件名,还包含文件所在路径。
并且,当你上传到服务器端后,你可以任意蹂躏这个文件,还管他叫什么名?
⑹ java中FileDialog 如何打开保存文件的窗口
FileDialog 过时了。
看一下:C:\Program Files\Java\jdk1.6.0_13\demo\jfc\Notepad\src
里面用的版是权 JFileChooser:
Frame frame = getFrame();
JFileChooser chooser = new JFileChooser();
int ret = chooser.showSaveDialog(frame);
if (ret != JFileChooser.APPROVE_OPTION) {
return;
}
File f = chooser.getSelectedFile();
frame.setTitle(f.getName());
Thread saver = new FileSaver(f, editor.getDocument());
saver.start();
⑺ 在Java中 FileDialog file=new FileDialog(who,"保存",FileDialog.SAVE);who是什么
public FileDialog(Frame parent,String title,int mode)创建一个具抄有指定标题的文件对袭话框窗口,用于加载或保存文件。
如果 mode 的值为 LOAD,那么文件对话框将查找要读取的文件,所显示的文件是当前目录中的文件。如果 mode 的值为 SAVE,则文件对话框将查找要写入文件的位置。
参数:
parent - 对话框的所有者
title - 对话框的标题
mode - 对话框的模式,可以是 FileDialog.LOAD 或 FileDialog.SAVE
你说的那个who也就是parent,一般打开某个FileDialog都会以模态的方式在某个Frame上打开,FileDialog所依附的Frame就是其parent
⑻ 求java 中filedialog的使用 例子
这个程序的源代码:
^...\Java\jdk1.6.0_05\demo\jfc\FileChooserDemo
在自己机器上找, if你装了JDK;