aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Accepting text in JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Accepting text in JTable" Watch "Accepting text in JTable" New topic
Author

Accepting text in JTable

Surya Kumar
Ranch Hand

Joined: Aug 21, 2004
Posts: 52
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


Regards<br />Prem<br />SCJP, SCJD, SCWCD, SCBCD, SCEA, SCJDWS
Itapaj� Takeguma
Ranch Hand

Joined: Jul 21, 2004
Posts: 41
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�.
Norm Poole
Greenhorn

Joined: May 08, 2004
Posts: 3
Try this:

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

});
Richard Jackson
Ranch Hand

Joined: Jun 25, 2003
Posts: 128
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?


Regards, Richard
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Accepting text in JTable
 
Similar Threads
JTable
Accepting text in JTable
JTable
JTable
JTable