Friday 15 June 2012

Deleting from arraylist and exporting back to .buab file(Java) -


I created an address book. I can currently write in the array list and save it back in the .buab file , But can I remove from the array list and export it back to .buab file?

Im too much got trapped on this. I was able to recover contacts from .buab and scrolled them using Jetextuffed and buttons.

For all the tasks, I have established septic classes (new contact, next contact etc.).

If you need a code posted to me, please tell me .. Cheers

P>

Dave

It's easy to add a deletion from a list:

  contact contact = new contact (); MyListOfContacts.add (contact); // Add a contact myListOfContacts.remove (contact); // contact away  

not necessarily more.

Edit

Please, and this is not Java, strictly separate three things, and your life will be very easy, will be very easy

  1. Models - Your contacts are stored in your array list
  2. Views - Your Jeffram is showing data from the model (list (list))
  3. Controller - The code behind your button that does something with the model (adding, removing, changing data in array list)

Maybe You've heard about the MVC pattern (Model-View-Controller).

So you do not export their 'Jeelaist: In your view on (Jefram), a button of your controller and press some code (actually may be in your button action listener) The file is executed for writing (your array list).

To do this, you do something to look for (GUI) to affect the removal, adding, importing model (list (list)).

As I said, it is not Java, it's different to try to find a very, very common pattern object view your code-oriented languages, models, views, controller and code Try. Promise, once you have done this, the next assignment will be a joke.


No comments:

Post a Comment