Results 1 to 3 of 3
- 01-01-2010, 08:10 PM #1
Member
- Join Date
- Dec 2009
- Posts
- 9
- Rep Power
- 0
JFileChooser - sequential files treatment
Hi,
I want to write an application where:
1. In JFileChooser - select multiple files
2. After clicking "Approve" button proper dialog window appears.
3. In dialog I enter parameters for first selected file and click OK.
4. File is processed in a background (it is transformed.
4. Window from point 3 appears again and actions 3 and 4 are repeated for the second, the third, fourth etc time- for each file selected previously in 1.
My application works fine for single file but I would like to implement"sequencing" files treatment. Can anybody help me to do it?
- 01-02-2010, 06:24 PM #2
Senior Member
- Join Date
- Aug 2009
- Location
- Pittsburgh, PA
- Posts
- 282
- Rep Power
- 4
The proposed user interface design would not be one I would like to use.
It is like having to choose all the nouns before writing a short story.
You should consider alternatives.
One possibility would be to use JFileChooser's setAccessory() method
to add buttons to the window. These buttons could be deisgned to
choose among the operations that are applied to files.
Then there would be only the one window with the file chooser;
the second window to choose an operation would be unneeded.
But let's suppose that you really want the design proposed.
Here's how:
First rearrange the main program so it is essentially:
Now the new program is simply this:Java Code:final JFileChooser fc = new JFileChooser(); int returnVal = fc.showOpenDialog(aComponent); chooseAndStartAnAction(fc.getSelectedFile());
Java Code:final JFileChooser fc = new JFileChooser(); fc.setMultiSelectionEnabled(true); int returnVal = fc.showOpenDialog(aComponent); File [] targets = fc.getSelectedFile[COLOR="Red"][B]s[/B][/COLOR](); for (File f : targets) chooseAndStartAnAction(f);
- 01-03-2010, 03:55 PM #3
Member
- Join Date
- Dec 2009
- Posts
- 9
- Rep Power
- 0
Similar Threads
-
Strange JFILECHOOSER behavior on Macs with ZIP files
By TimHuey in forum New To JavaReplies: 6Last Post: 09-04-2009, 02:48 AM -
Realize default value/sequential number in reporting tool
By freezea in forum Reviews / AdvertisingReplies: 0Last Post: 04-21-2009, 07:08 AM -
Realize default value/sequential number in reporting tool
By freezea in forum Reviews / AdvertisingReplies: 0Last Post: 04-13-2009, 04:25 PM -
Sequential Access Problem - Nothing is being written to file.
By shelzmike in forum New To JavaReplies: 4Last Post: 12-03-2008, 11:07 PM -
Problem with Sequential File and Arrays
By rhivka in forum New To JavaReplies: 8Last Post: 07-30-2007, 09:03 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks