• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Updating a JTable

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having trouble updating a JTable. I've a JTable that's showing certain fields. But when I want to assign a new JTable there, the change isn't seen. In the following code, when the [bold]button is clicked, no change occurs. How can I achieve the desired behaviour?[/bold]

 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A gui is its own little world. Once you add a component to it, it (the gui) owns and manages the component. Pointing the reference to another component has no affect on the component previously added, it just means that you can no longer use the reference to get to the added component. To change components the technique is to first remove a component from the gui. Then you are free to add another in its place.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lightning Bug,

Welcome to Javaranch! We don't have too many rules around here but we do have a Naming Policy. Please read this and adjust your display name accordingly. You can change your display name by clicking [url=https://coderanch.com/forums/user/edit]here[url].

Thanks.
 
Mousa A. Rafi
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gregg Bolinger::
Sorry about not conforming with the policy. Actually I was not so much aware of the fact. The reason for not using my real name is that I wanted to avoid any sort of discrimination. Anyway I will change the name.

Craig Wood::
Thanks for your reply to the original thread. It was of a great help to me in programming with SWING and understand them better.

[ February 07, 2005: Message edited by: Lightning Bug ]
[ February 07, 2005: Message edited by: Lightning Bug ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Lightning Bug:
Gregg Bolinger::
Sorry about not conforming with the policy. Actually I was not so much aware of the fact. The reason for not using my real name is that I wanted to avoid any sort of discrimination. Anyway I will change the name.



No problem. We feel that Javaranch is a pretty friendly place and we have a host of different people from all over the world here but on the offchance you do feel discrimated against please notify me or another Bartender or Sheriff immediatly and we will take care of the situation ASAP.

Thanks and again, welcome to Javaranch!!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic