• Post Reply Bookmark Topic Watch Topic
  • New Topic

Save ...  RSS feed

 
jack T.
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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. ]
 
Sathya Sekar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!