This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes How to update randomaccessfile Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "How to update randomaccessfile" Watch "How to update randomaccessfile" New topic
Author

How to update randomaccessfile

Don Wettasinghe
Greenhorn

Joined: Apr 17, 2010
Posts: 3
I'm studying Java,

I wrote a Address book for practice.
Actually I follow a sample and finally finish. It work fine. It has Add new, Move Next, Move Last, Move First, Clear Buttons. I need to add UPDATE Button. I already Add that button. How can I do the coding?

I don't know how to play with " seek(position)"

Can anybody give some Example code please?


Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32675
    
    4
You ought to separate the logic ("M" for Model) from the class which displays the GUI ("V" for view). I would suggest you have a File object which contains data corresponding to Address objects. Then you can find an Address object, and a way to write it into the file. You would need to find a particular Address object before trying to update it.

Move the clear instructions out of the clear button actionPerformed method into a clearDisplay() method and call clearDisplay() from the actionPerformed method.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to update randomaccessfile
 
Similar Threads
Switching between the frames
Adding images to a JPanel based on JComboBox selection.
drawing a curve from points
Adding Record Problem in JDBC ?
Frames