• 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

Accepting text in JTable

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a Jtable and a set of Jbuttons. Whats happening is when the user enters some value in the Jtable and clicks on these buttons the new value is not yet applied to the model calsses hence not taken into consideration. If i press the enter key or tab out of that field then it was taken.

Is there any way so that a cell value is applied to the model even if a button is pressed. Regards
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Surya Kumar:
I have a Jtable and a set of Jbuttons. Whats happening is when the user enters some value in the Jtable and clicks on these buttons the new value is not yet applied to the model calsses hence not taken into consideration. If i press the enter key or tab out of that field then it was taken.

Is there any way so that a cell value is applied to the model even if a button is pressed. Regards



You could see of Component. I don't have this problem because when the user wants to change a value, he presses a button and a update frame is openned.

Itapaj�.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this:

table.addFocusListener(new FocusAdapter(){
public void focusLost(FocusEvent e){
table.getCellEditor().cancelCellEditing();
}

});
 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,Itapaje

I don't have this problem because when the user wants to change a value, he presses a button and a update frame is openned.


As you mean, a new frame which ask user for enter update record info will occurs,won't it?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic