Results 1 to 8 of 8
Thread: jfilechooser
- 05-28-2010, 11:23 AM #1
Member
- Join Date
- May 2010
- Posts
- 9
- Rep Power
- 0
jfilechooser
Hi
I am writing an app that is needs to open dicom imgs(a format for CT images)
when I opened only 1 img I did it by:
opening a jfilechooser and the file I got back was of type win32ShellFolder2
using this file I created an Imageinputstream and read the file.
however now I am trying to open more then 1 file
so I choose a directory from the JFileChooser
get the list of files it contains and open them by
File f = new File(list[i]);
this opens the files as file object which is not good for me
any suggestions on how to open them as win32ShellFolder2
?????
10x
Ran
- 06-02-2010, 11:34 AM #2
Member
- Join Date
- May 2010
- Posts
- 9
- Rep Power
- 0
Plz
someone
- 06-02-2010, 03:56 PM #3
Cross posted.
- 06-02-2010, 04:09 PM #4
Senior Member
- Join Date
- Mar 2010
- Location
- Manila, Philippines
- Posts
- 257
- Rep Power
- 4
Then you should understand further the JFileChooser API.
I think there is a method their that could solve your problem.
I'm not sure of that. But I have read a book on how to read the files in the directory (not sure about the folders).Every project, package, class, method, variable, syntax, algorithm, etc.
are registered in my memory bank. Thanks to this thread.
- 06-03-2010, 01:35 AM #5
Member
- Join Date
- May 2010
- Posts
- 9
- Rep Power
- 0
getting a file
I have no problem getting a file
however getting all files from folder is the problem
if I want them to fit the type
- 06-03-2010, 06:42 AM #6
Senior Member
- Join Date
- Mar 2010
- Location
- Manila, Philippines
- Posts
- 257
- Rep Power
- 4
Well I think u must be able to filter all the files in the directory.
I mean all the files you need.
I have read a code in a book that could read all the files in the directory (not sure about the folders also about the filter). But in that way, you could implement in your code that manner.
I will give you the logic of the code once I visited the school library.Every project, package, class, method, variable, syntax, algorithm, etc.
are registered in my memory bank. Thanks to this thread.
- 06-03-2010, 08:38 AM #7
Member
- Join Date
- May 2010
- Posts
- 9
- Rep Power
- 0
this is stil the easy part
string[] list = f.getFileList(or something like that)
for(int i=0;i<list.length;i++){
file = new File(list[i])
openfile(file)//this methode is mine
}
all I need is the how to open each file and file as a win32shellfolder and not as file
- 06-03-2010, 02:44 PM #8
Senior Member
- Join Date
- Feb 2009
- Posts
- 303
- Rep Power
- 5
The Win32ShellFolder was replaced with Win32ShellFolder2 after version 1.4.2.
You can make Win32ShellFolder2 objects by instantiating a Win32ShellFolderManager2 object. It has a method called createShellFolder(File) which takes in File objects and returns a corresponding Win32ShellFolder2 objects.
If you are version 1.4.2 or before I believe there was a similar object called Win32ShellFolderManager.
Similar Threads
-
Jfilechooser
By greatmajestics in forum Java 2DReplies: 5Last Post: 03-30-2010, 06:13 PM -
help with JFileChooser
By morgatron in forum New To JavaReplies: 1Last Post: 01-08-2010, 09:00 AM -
JfileChooser Help
By simmi in forum AWT / SwingReplies: 9Last Post: 08-04-2009, 02:24 AM -
using jfilechooser
By jagadhguru in forum AWT / SwingReplies: 3Last Post: 10-30-2008, 12:17 PM -
how to use JFileChooser
By tommy in forum New To JavaReplies: 1Last Post: 08-06-2007, 08:49 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks