Yes the DataSite objects are in both models , so how would I be able to separate them?
Will adding STATIC to private Map<DataSite,Integer> siteToIndexMap = new HashMap<DataSite,Integer>();
Main Topics
Browse All Topics
Hello all,
I'm having trouble getting my application to modify the Jtables appropriately.
I have :
1) Main Jframe window with a Jtable that lists web site URL's --> (WebSiteListTableModel)
2) Child Jdialog with Jtable listing all the available sites (with a checkbox to select the site(s) ) --> (PreferencesTableModel)
When I make modifications to the PreferencesTableModel the values from WebSiteListTableModel get affected instantly.
I don't want this effect because I want them to "choose the URL's they want" then APPLY the changes when they press the APPLY jButton, not as soon as a site get's checked.
how can I setup the PreferencesTableModel to allow changes to be made separate from WebSiteListTableModel?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
OK so If I'll try make a Separate DataSiteList Object (which hold many Sites)
but is there a way I can assign the DataSiteList object from PreferencesTableModel to the DataSiteList in WebSiteTableModel?
DataSiteList is a Hashmap that hold many site objects (each site is basically a web site name, url, etc)
I was thinking along the lines of :
WebSiteTableModel model = (WebSiteTableModel) myPreferencesTableModel;
is that possible in any way so I can "Tell" the WebSiteTableModel the changes made from the PreferencesTableModel?
If you can give me an example of the code which would let me assign the underlying object(DataSite) from the Preferences to WebSiteList model.
Thanks again, I'm getting warmer!
You could use a copy constructor:
public DataSite(DateSite other) {
//
}
or depending on the nature of the class itself, it might be possible just to make it Cloneable. But beware! Even with a clone, you could end up with a shallow clone when you need a deep one. Look into shallow/deep copy or clone and check the references in each object's reference tree
Business Accounts
Answer for Membership
by: CEHJPosted on 2009-11-05 at 10:06:22ID: 25752157
Difficult to say exactly as you haven't given much code, but check that the same DataSite objects are not appearing in both models