This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable update from JDialog ?

 
mohana konakanchi
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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..
Mohana

 
Manfred Leonhardt
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,
Manfred.
 
mohana konakanchi
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI
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
Mohana
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic