| Author |
How to update a row in view if i sort a column in my model?
|
Supriya Satapathy
Greenhorn
Joined: Jun 19, 2009
Posts: 5
|
|
Hi,
Sorry!! I am new to Swing. The terminology that i use it may wrong.
I have a window contains 3 columns and 60 rows. If i double click a row then it opens a pop up window and i get a row index. I modified something in my pop-up window. But before i save it, i come to parent window and intentionally/unintentionally sorted a particular column. Then row index of that selected row got changed and in my coding i am getting another row index, the correct one only. Then i come to pop up window and trying to save the modification.When i update with new row index then it is updating a row with this new row index value in before sorted window not in the sorted window. I mean updating is happening in the window which i first time opened, i mean before i sort. So, i would like to have some code how to update a row correctly and that i can see in sorted window correctly?
Please help me,
Urgent issue
|
 |
Rob Camick
Ranch Hand
Joined: Jun 13, 2009
Posts: 1808
|
|
I have a window contains 3 columns and 60 rows
I assume you mean you added a JTable to a window.
I modified something in my pop-up window. But before i save it, i come to parent window and intentionally/unintentionally sorted a particular column.
If I understand the question then your "pop-up" should be a modal JDialog. That way you won't be able to click on the parent JFrame until the dialog is closed.
|
 |
Supriya Satapathy
Greenhorn
Joined: Jun 19, 2009
Posts: 5
|
|
no, it is JInternalFrame only. Not JDialog.
Yes I have added a JTable.
|
 |
Rob Camick
Ranch Hand
Joined: Jun 13, 2009
Posts: 1808
|
|
Well, thats what I'm suggesting. It SHOULD be a JDialog, NOT an internal frame.
|
 |
Supriya Satapathy
Greenhorn
Joined: Jun 19, 2009
Posts: 5
|
|
I understood. But one problem is there. I cann't implement JDialog inplace of JInternalFrame. Because my entire application's all windows getting using JDesktopane. I am adding & getting all frames from JDesktoppane.
Please help me with some other approach.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
|
Perhaps you can disable the source frame using setEnabled(false), then reenable it when the "popup" frame is closed. There is a listener for that event.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Supriya Satapathy
Greenhorn
Joined: Jun 19, 2009
Posts: 5
|
|
|
Could please tell me that which listener i can use in parent frame?
|
 |
Supriya Satapathy
Greenhorn
Joined: Jun 19, 2009
Posts: 5
|
|
|
If i write table.setEnabled(false); while mouseClicked double times. It is not working. Still I am able to sort the parent window.
|
 |
 |
|
|
subject: How to update a row in view if i sort a column in my model?
|
|
|