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
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.
Joined: May 16, 2001
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