• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no, it is JInternalFrame only. Not JDialog.
Yes I have added a JTable.
 
Rob Camick
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic