This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- How can i create a "Browse For Folder" dialog.
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 03, 2008
12:57 AM
How can i create a "Browse For Folder" dialog.
Hi All,
Please help me in creating a "Browse for Folder" Dialog through Custom Code so that I can browse and select the necessary directory.
If anybody have the code snippets, please share.
Thanks
Sumode
Please help me in creating a "Browse for Folder" Dialog through Custom Code so that I can browse and select the necessary directory.
If anybody have the code snippets, please share.
Thanks
Sumode
(6) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 03, 2008
04:11 AM
First write a java class which extends from CustomCodePanel class and
import package com.zerog.ia.api.pub.*;
Use netbeans ide and create a simple jpanel and add button. then copy the autogenerated code to ur class .
Add a listener to button and on event write code to create JFileChooser
and setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY) as following
final JFileChooser fc = new JFileChooser();
JList list = new JList();
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
if (JFileChooser.APPROVE_OPTION == fc.showOpenDialog(list)) {
File file = fc.getSelectedFile();
}
import package com.zerog.ia.api.pub.*;
Use netbeans ide and create a simple jpanel and add button. then copy the autogenerated code to ur class .
Add a listener to button and on event write code to create JFileChooser
and setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY) as following
final JFileChooser fc = new JFileChooser();
JList list = new JList();
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
if (JFileChooser.APPROVE_OPTION == fc.showOpenDialog(list)) {
File file = fc.getSelectedFile();
}
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 03, 2008
05:24 AM
hi,
You have to create a jni library which contains a method which uses native
api to display Browse for folder dialog.At present the dialog which u see is displayed using Swing.
I was facing the same problem but for Mac.
So I created a jni library which force java to use awt to display BrowseDilaog.
Now I am succeeded but the only problem is I have to put this library manually inside app directory.U can go through the my previous post on 31 october.
If you find any other way to diaplay standard browse folder dialog box please let me also know.
Thanks,
-kpant
You have to create a jni library which contains a method which uses native
api to display Browse for folder dialog.At present the dialog which u see is displayed using Swing.
I was facing the same problem but for Mac.
So I created a jni library which force java to use awt to display BrowseDilaog.
Now I am succeeded but the only problem is I have to put this library manually inside app directory.U can go through the my previous post on 31 october.
If you find any other way to diaplay standard browse folder dialog box please let me also know.
Thanks,
-kpant
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 03, 2008
11:36 PM
Thanks for the information.
Is there any custom code APIs (known) available to create the 'Browse For Folder' dialog?
Sumode
Is there any custom code APIs (known) available to create the 'Browse For Folder' dialog?
Sumode
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 04, 2008
06:55 AM
Hi,
I am feeling very great that I have solved this problem for Mac OS.
I wrote a method ExtractFromJar to extract my jnilib from jar.
The first dialog box is displayed using Swing.
The second dialog box is displayed via a jni library which uses native mac API's.
Soon I will be doing the same for windows.
I am feeling very great that I have solved this problem for Mac OS.
I wrote a method ExtractFromJar to extract my jnilib from jar.
The first dialog box is displayed using Swing.
The second dialog box is displayed via a jni library which uses native mac API's.
Soon I will be doing the same for windows.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 25, 2008
05:11 PM
Copy the logic already built in the default dialog for the folder selection.
You can find it in the list of dialogs in the IDE.
You can find it in the list of dialogs in the IDE.
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)