• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

JTable update from JDialog ?

Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to update a row in a JTable. Since I am using subclass of AbstractTableModel(let's say MyTableModel) to fill table data, I can update a table by updating tabel model class. Until this point things are fine.
I am instantiating a JDialog subclass from JApplet. Now I have to update JTable (Which resides inside JApplet) row depending on data sent by JDialog(It's model dialog).
I tried to pass JTable/MyTableModel object to JDailog constructer and access addRow (custom method) in the MyTableModel. But it's giving an error, saying " only final local variables are available", But I can not make JTable or MyTableModel as final.
Is there any alternate to pass data from JDailog to MyTableModel?
thanks in advance..

Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mohana,
IMOP, since your dialog is modal the JApplet code should be hanging on the show method call. In other words, your applet will wait on that line until your dialog is dismissed. You should then be able to perform anything you want depending on what happened in the dialog...

I have not really tried this, but it should work...
Hope this helps,
mohana konakanchi
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reply,
When I am using subclass of JDialog. I could not able to update JTableModel, since I can not able to get JTableModel handle.
SO I tried to create a superclass which extends JApplet.
I put a handle for JTableModel. I am taking this handle in my Dialog applet.(It's not model dialog now). It's working fine with out any problem.
I do not know my explanation is clear to you.
forget it, Now I have got new problem,
I have to make a my Applet which is not extended from JDialog as should act as model dialog, I am not good in threads.. can help me out in this my giving example.
thanks once again
We're being followed by intergalactic spies! Quick! Take this tiny ad!
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic