Results 1 to 8 of 8

Thread: jfilechooser

  1. #1
    ranadav is offline Member
    Join Date
    May 2010
    Posts
    9
    Rep Power
    0

    Default 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

  2. #2
    ranadav is offline Member
    Join Date
    May 2010
    Posts
    9
    Rep Power
    0

    Default

    Plz
    someone

  3. #3
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,321
    Rep Power
    25

    Default

    Cross posted.

  4. #4
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Default

    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.

  5. #5
    ranadav is offline Member
    Join Date
    May 2010
    Posts
    9
    Rep Power
    0

    Default 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

  6. #6
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Default

    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.

  7. #7
    ranadav is offline Member
    Join Date
    May 2010
    Posts
    9
    Rep Power
    0

    Default

    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

  8. #8
    StormyWaters is offline Senior Member
    Join Date
    Feb 2009
    Posts
    305
    Rep Power
    6

    Default

    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

  1. Jfilechooser
    By greatmajestics in forum Java 2D
    Replies: 5
    Last Post: 03-30-2010, 06:13 PM
  2. help with JFileChooser
    By morgatron in forum New To Java
    Replies: 1
    Last Post: 01-08-2010, 09:00 AM
  3. JfileChooser Help
    By simmi in forum AWT / Swing
    Replies: 9
    Last Post: 08-04-2009, 02:24 AM
  4. using jfilechooser
    By jagadhguru in forum AWT / Swing
    Replies: 3
    Last Post: 10-30-2008, 12:17 PM
  5. how to use JFileChooser
    By tommy in forum New To Java
    Replies: 1
    Last Post: 08-06-2007, 08:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •