Results 1 to 3 of 3
- 02-07-2010, 02:32 PM #1
Member
- Join Date
- Feb 2010
- Posts
- 1
- Rep Power
- 0
How to open a SAVE file dialog box without using SWING or AWT
Hi All,
I am a new member of this forum and this is my first post.
I want to use the "SAVE" file dialogue box (as it comes in windows asking where do you want to save a file) for saving a file. But I don't want to use AWT or SWING for this. Is there any option for this?
- 02-07-2010, 05:38 PM #2
in theory, it might be possible to create a kind of native component, in your native windows language of choice, such as dot net, visual C++, visual basic ? Once the file dialog is created and invoked from this native piece of code, design an interface that is suitable for use throw the Java Native Interface (JNI), where you create a java stub class that invokes this native method, atht causes the native file save dialog to be shown in your native look and feel.
The challenges with this are after invoking the dialog, the dialog results need to be communicated back to the java process, which would then use either use a java mechanism for saving the file, or (gasp), somehow send the file contents back through the native gui stub piece of code to have it save it.
There also might be something like this (a native screen kind of thing with a Java bindings) in some of the existing open source cross platform native widget toolkits, such as GTK+, WxWidgets, or QT., and assuming you have Java bindings to just show a file save dialog. Though using one of these would only be good to do if you are already used to working with them.
But thats a lot of theory, I seriously doubt it is worth the trouble to go to that much effort just to have a native windows save dialog in a java application. You might as well then just write your application in some kind of native windows API code.
Now, for Swing, there are several different look and feel options. Since Java 1.6 some of these have improved quite a bit to look closer to the native windowing system. How to Set the Look and Feel (The Java™ Tutorials > Creating a GUI With JFC/Swing > Modifying the Look and Feel)
Another option is the SWT from eclipse. That is a Java UI similar to what Swing does.
But I suspect the motivation for using the native save dialog is to take advantage of some of the windows standard left tree menus of folders and shares or something ?
- 02-25-2010, 01:30 AM #3
Member
- Join Date
- Feb 2010
- Posts
- 1
- Rep Power
- 0
You can use Swing and call the native FileDialog (Windows CFileDialog or GTK Filedialog) with JNI.
I wrote a wrapper class for Windows CFileDialog, and shared its source/dll on my Google page code. xfiledialog - Project Hosting on Google Code
Another option is to write you program completely in SWT.
Similar Threads
-
How invoke open dialog?
By artemff in forum CLDC and MIDPReplies: 4Last Post: 12-27-2009, 03:18 PM -
save dialog problem
By masa in forum AWT / SwingReplies: 2Last Post: 03-06-2009, 12:41 AM -
File dialog with save
By manpreet in forum New To JavaReplies: 1Last Post: 01-02-2009, 05:44 PM -
Open "Save Page As" Dialog Box
By Anubha in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 12-12-2007, 09:27 PM -
File Save not showing FileSAVE dialog box , getting displayed in browser
By deepdba in forum Java ServletReplies: 0Last Post: 12-06-2007, 06:10 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks