⑴ 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;