我只是想知道: Gmail 如何使用 Windows/ Mac 文件选择器上传文件? 在 Java 上传文件有什么办法吗?
就个人而言,我不喜欢 JFileChooser
看上去的样子,我认为我的用户最好能够使用他们更习惯使用的东西。 提示谁?
我只是想知道: Gmail 如何使用 Windows/ Mac 文件选择器上传文件? 在 Java 上传文件有什么办法吗?
就个人而言,我不喜欢 JFileChooser
看上去的样子,我认为我的用户最好能够使用他们更习惯使用的东西。 提示谁?
使用旧的 java.awt.
new java.awt.FileDialog((java.awt.Frame) null).setVisible(true);
你可以尝试使用 JFileChoooser,但设置外观和感觉 成为平台的外观和感觉:
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}catch(Exception ex) {
ex.printStackTrace();
}
这样所有摆动部件都会更漂亮!
GMail 是一个最终依靠浏览器显示此组件的网络应用程序。 现在一个很好的解决方案是使用“ 本地 Look& Feel” 系统, 提供与您显示的类似 JFileChooser 的 JFileChooser 系统 :
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
"https://i.sstatic.net/kgzRi.png" alt="此处的内置图像描述"/ >
脉冲星的解决方案更好,因为它提供了您正在寻找的精确对话框。 我不确定它是否提供了 JFileChooser 的所有功能 。
< a href=" "http://en.wikipedia.org/wiki/Standard_Wifet_Toolkit" rel = "no follow" >SWT 组件总是看起来与运行中的 OS 中相同的样式。 您可以看到一些例子 :
假定从爪哇第七版起,摇摆风格更像操作系统,但在爪哇八版中可以看到。
Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...
Check this, List<String> list = new ArrayList<String>(); for (int i = 0; i < 10000; i++) { String value = (""+UUID.randomUUID().getLeastSignificantBits()).substring(3, ...
I am in the middle of solving a problem where I think it s best suited for a decorator and a state pattern. The high level setting is something like a sandwich maker and dispenser, where I have a set ...
I have been trying to execute a MS SQL Server stored procedure via JDBC today and have been unsuccessful thus far. The stored procedure has 1 input and 1 output parameter. With every combination I ...
I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...
If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...
I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....
I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...