• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to update a row in view if i sort a column in my model?

 
Supriya Satapathy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2599
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no, it is JInternalFrame only. Not JDialog.
Yes I have added a JTable.
 
Rob Camick
Ranch Hand
Posts: 2599
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Well, thats what I'm suggesting. It SHOULD be a JDialog, NOT an internal frame.

 
Supriya Satapathy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20545
56
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Supriya Satapathy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could please tell me that which listener i can use in parent frame?
 
Supriya Satapathy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i write table.setEnabled(false); while mouseClicked double times. It is not working. Still I am able to sort the parent window.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic