• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Save ...

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, i am writing a small editor and need a bit of help here.What i need is to save a file so that save dialog doesn't apper each time.Ie if i have a new file then show the dialog else just write to a file.I have tried something like this but :
Anyone can help me ?
[ December 17, 2003: Message edited by: jack T. ]
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Its been a long time since I worked with Swing - but couldnt you have your listener object which controls the behaviour ? You could maintain a File object reference - if this is null, show up a file dialog, get the file reference and save to disk. On subsequent saves, since you have a File reference already, you should simply write to the same stream rather than bringing up a dialog.
I know I did a Java Text Editor some time ago - shall try to get you the relevant code.
 
jack T.
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey , thanks for your reply but i already done it.
Do you know any Carret class in java cos i need it for the paste function ?What i need is to find the current position where to paste the text.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic