如何调用/或者制作“浏览文件夹”对话框? 要求是;1.JDK环境为1.3,1.5的不用说了。2.认为是JFileChooser的也不用说了。3.欢迎提供讲解Java的shell API函数操作技术。大家快快解答拿高分。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Windows API SHBrowseforFolder or www.jgoodies.com/freeware/jdiskreport/ 看下JDIC,JDK1.5的功能也是调用这个的 java.awt.FileDialog从jdk1.0开始就支持了 FileDialog(Frame f,String label,int mode);mode:FileDialog.LOAD // 打开文件对话框FileDialog.SAVE //保存文件对话框 Windows API SHBrowseforFolder这个好像可以。 JNI不是可以调用window 的api吗? 不知道这个行不行,我在eclipse论坛上发的swt的帖子public class FileUpLoad { public static void main(String[] args) { Display display = Display.getDefault(); final Shell shell = new Shell(); final GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; shell.setLayout(gridLayout); shell.setSize(500, 375); shell.setText("SWT Application"); shell.open(); Label label = new Label(shell, SWT.NONE); label.setText("上传下载例子"); Text text = new Text(shell, SWT.BORDER); text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); Button button = new Button(shell, SWT.PUSH); button.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { FileDialog f = new FileDialog(shell); f.setFilterPath("%SYSTEMDRIVE%\\Documents and Settings\\All Users\\桌面"); String path = f.open(); if(path!=null){ text.setText(path); } } }); button.setText("浏览"); shell.layout(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } }} 给单词表排个序 会的来帮个忙 急!!!!!!!,关于字符串解析 的一个问题,谢谢! 求教关于-“子类特性丧失” 我的eclipse是3.1.1如何与WEBLOGIC结合运行 【请教】Mysql数据库安全问题一问 播放音频 哪里出错了呢? 关于解决在任何有能上网有浏览器的的机器(没装jdk)上运行Applet的方法 如何在 JAVA 应用程序里播放声音 ???? 请问那种JAVA工具带有丰富的控件(组件),就象VB MSCHART 关于静态方法调用变量问题,谢谢!急~! 高手帮我下 用java编写月历,有没有可以调用的函数?
从jdk1.0开始就支持了
FileDialog.LOAD // 打开文件对话框
FileDialog.SAVE //保存文件对话框
这个好像可以。
public class FileUpLoad {
public static void main(String[] args) {
Display display = Display.getDefault();
final Shell shell = new Shell();
final GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 2;
shell.setLayout(gridLayout);
shell.setSize(500, 375);
shell.setText("SWT Application");
shell.open();
Label label = new Label(shell, SWT.NONE);
label.setText("上传下载例子"); Text text = new Text(shell, SWT.BORDER);
text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
Button button = new Button(shell, SWT.PUSH);
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
FileDialog f = new FileDialog(shell);
f.setFilterPath("%SYSTEMDRIVE%\\Documents and Settings\\All Users\\桌面");
String path = f.open();
if(path!=null){
text.setText(path);
}
}
});
button.setText("浏览");
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
}