i'm creating a guestbook in java wherein it gets inputs(name,message) from a user then it will store this as an object. it basically works like a guestbook in webpages only that it will have a delete option. how can i do this? can anyone give me an idea please.

Recommended Answers

All 2 Replies

>how can i do this?
By opening your Java book and figuring out how to do each of the parts of this program. Can you read a name and a message? Can you write a class to hold a message? Can you display text? Get that working with an array first, then you can switch to a more complicated data structure like a linked list.

And by the way, just about every book on programming out there has a decent description of linked lists along with an implementation. Double linked lists are just a simple jump up from single linked lists. The only relatively hard part is making sure that all pointers are updated properly.

So, what exactly are you having trouble with?

yeah, i can read the name and message.. but my program should have a delete option and i don't know how to do it. i can do it with arrays but my project requires me to use doubly linked list not arrays. every post has a message number. and the most recent should be at the top but it doesn't. then i have this textfield that gets the message number to refer to the message to delete. i think this approach is wrong. i have two constructors in my helper class(the main class is a gui), one gets all the strings needed(name,message etc.) and the other gets this object and sets its prev and next links. using this object i can't access the strings.
this is what my code looks like: (wherein o is the object)
item1 = o.element().getame();

i really need help! thanks for replying in advance. more power.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.