I am working on javafx 2. but there is no feature of multiple folders and files available on the filechooser.
There is the Directory chooser but it selects only one folder. How can i solve this problem. Please give me any suggestion?
JavaFX supports single and multiple file dialogs:
http://docs.oracle.com/javafx/2/api/javafx/stage/FileChooser.html
and single directory dialog:
http://docs.oracle.com/javafx/2/api/javafx/stage/DirectoryChooser.html
There was a special RFE for this : https://bugs.openjdk.java.net/browse/JDK-8101526.
There is a special RFE for multiple directories chosign, you can wait, until it will be fixed : https://bugs.openjdk.java.net/browse/JDK-8091403, also, you can vote it up, for it to be fixed with higher priority
We can use JFileChooer of Swing component. But then its give error like Headless something. So remove this error by following steps.
1) Initialised all component of swing before javafx.
2) use System.setProperty and set Headless false .
Then jfilechooser works. Thanks to all.
Related
I have an Exe file created using Java Swing. I recently added a below code to open multiple session of an application at the same time. It works fine.
Runtime.getRuntime().exec("C:\Auto\format.exe")
The application is used by different users and hence they are forced to save the application on the same path. If not, they would be able to open multiple sessions.
How do I avoid using path here on this code or Is there a better option for me?
Thanks in Advance.
You could get rid of the path, when your *.exe file is in the same folder or subfolder of your Java program.
The only thing you need to care about is, that of your program is installed on somes computer, that you take the *.exe with you. You just could copy the files or you could create an installer (my suggestion).
In my Java application I am using JFileChooser for choosing files from directory. I would like to select multiple files with dragging mouse over them. By default it's not working, but I enabled multiple selection. I don't know how to do it.
Is there any other way to do it or any other API? Any help will be gladly appreciated.
After searching a lot I found an API namely ,
Native Swing "The DJ Project"
In this API ,there is a class "JFileDialog" this is what i was looking for.This filedialog allows multiple selection with mouse drag and also better than Jfilechooser in the point of look and feel.But before Using this API one must have to add DJNativeSwing.jar , DJNativeSwing-SWT.jar , swt-4.3-win32-win32-x86.jar library to the project build path and also the project should be Run with 32-bit JRE .
see this snippet of code as example from this link : https://dzone.com/articles/native-dialogs-swing-little
how to control windows right click context menu for file folder using java, Is there any possibility for doing this using java. i want that if user create/edit/delete any file/folder in given/specific folder before that operation my java program get the user's action and allow or dis-allow user for doing that.
Please help me how can i do that, doing R&D for that but not found any solution yet. need some guide line for how to achieve this if possible.
Thanks in advance.
In my project, I use some files in a directory. And for some reasons, I must load the files at the launch of the project, and if there is an action on these files, I must reload them (in a HashMap)
For the moment, I load them just at the moment of the use, but I want to do this at the load of application, and let the JNotify working all the time.
I am working on a web project. Can I have some help please ?
thnx
Other than manually polling the file system yourself, JNotify (or a library like it) is probably your best option for now. There are changes planned for Java 7 that will address the need for this (see the WatchService section on the linked page).
Edit:
On closer reading of your question, I understand that you're not really looking for alternatives, but for help in using JNotify. See the code samples section. You need to add a watch to the directory or files you're watching, and add your own class as a Listener for change events. You'll need to implement JNotifyListener in your code and handle the events that you're interested in.
I used a Servlet that I launch in the begining of the application.
I create the JNotify in the init() method, and because it have Listeners, it will listen to the directories that I want to watch all the life of the Servlet.
Thnx for you answers.
I have an Eclipse workbench application composed of many plugins. I'd like to set the about text of the app to reflect the build number.
There seems to be a couple of places to do this:
- Inside the application's .product file (setting text here doesn't seem to do anything?)
- Inside the plugin.xml file of the main plugin (this does seem to work).
I have two questions:
What is the best way to achieve this? via plugin.xml?
Why is the text I set in the product file ignored?
It (text and picture of an about dialog) should be in the about.ini of a feature or product plugin.
Note: for the picture, this blog entry "How Can I Give My Eclipse Blob An Icon In The Flippin’ About Dialog?" is quite nice.
Notebis: with the latest 3.5Mx releases, the about box is even more configurable.