Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-22-2008, 03:19 AM
Member
 
Join Date: Nov 2008
Posts: 33
Rep Power: 0
Bomber_Will is on a distinguished road
Default Deleting and Adding Lists in Java Applets
The coding to this is in my other topic on this section but I'm not allowed to link until I have a post count of 20.

Is their a way to make a choice list in the applet that when you pick on a choice, creates a new list? Then if the user picks a new choice from the first list, it deletes the second list and makes a new list.

Example:
-User opens the applet and sees List 1 with Choice A, Choice B, Choice C.
-User picks Choice A from List 1 and it creates a List 2 with Choice D, Choice E, Choice F
-User goes back to List 1 and picks Choice B
-List 2 gets deleted and List 3 is created with Choice G, Choice H, Choice I

The only way I'm thinking is to make a class per choice but I don't even know if that would delete automatically or not and I am not sure how to delete specific things. Last time I tried to delete one list, I managed to delete everything but the first Label created.
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 11-23-2008, 04:01 PM
Nicholas Jordan's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Southwest
Posts: 1,018
Rep Power: 3
Nicholas Jordan is on a distinguished road
Default
Have you looked into JListControl?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 11-24-2008, 08:39 AM
Member
 
Join Date: Nov 2008
Posts: 33
Rep Power: 0
Bomber_Will is on a distinguished road
Default
I just looked into JList and it seems that clear() method almost does what I want. I just need to find a way for it to clear 1 section instead of the entire applet. Thanks, i'll keep looking.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 11-27-2008, 05:03 PM
Nicholas Jordan's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Southwest
Posts: 1,018
Rep Power: 3
Nicholas Jordan is on a distinguished road
Default
Very likely, what you need to do is call new on each new List, depends on system loading and so on. For each section, have one list. You can have an array of Lists or a list of lists. Sounds like new operator is what you want.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
.
Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 11-28-2008, 06:52 AM
Member
 
Join Date: Nov 2008
Posts: 33
Rep Power: 0
Bomber_Will is on a distinguished road
Default
I saw somewhere that they had a list, cleared it, and put it back along with a new option and new lists under it. That would be a way to get what I want and it seems pretty easy to do. I found a few books that'll help me with my second problem of connecting to a database, hopefully I can make sense out of it so I can knock out the connecting to a database and this list problem at the same time.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rotating objects in Java Applets Unome Java Applets 1 10-17-2008 07:35 AM
Java Applets - lifecycle - II JavaForums Java Blogs 0 06-20-2008 03:53 AM
Java Applets - lifecycle - I JavaForums Java Blogs 0 06-20-2008 03:53 AM
Java Collection Framework (Lists) Java Tutorial Java Tutorials 1 05-16-2008 01:44 PM
reading dir in java applets willemjav Java Applets 3 02-07-2008 12:36 AM


All times are GMT +2. The time now is 10:04 PM.



VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org