• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

Download dialog box

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a simple java application with Swing as the front end.There is no web based module in it.
I obtain some data from various tables in a database and then made a csv file out of it using :



I want this new csv file created to appear as windows download dialog box with options 'open' 'save' and 'cancel'.How do I do this?

Thanks in advance.
 
Marshal
Posts: 79800
385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you mean using the JFileChooser class?
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So far as I know, you can't pop up the Windows download dialog box. That's a feature of Internet Explorer (or any other web browser). If you want to prompt the user to save the file somewhere, then you need to use the JFileChooser object:



You can read up about it at Sun's tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html
 
Shibin Paul
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you all for the replies.
Ya Campbell using JFileChooser.
Morever it works with saveDialog but wanted both open, save and cancel all in one dialog.
If possible with any other Swing or AWT component also.
 
Campbell Ritchie
Marshal
Posts: 79800
385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can have open and cancel or you can have save and cancel. I have never seen a dialogue which allows open and save both together.
reply
    Bookmark Topic Watch Topic
  • New Topic