-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0, 1.4.1, 1.4.2
-
rc
-
x86
-
windows_98, windows_2000
Name: gm110360 Date: 06/27/2002
FULL PRODUCT VERSION :
java version "1.4.1-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b14)
Java HotSpot(TM) Client VM (build 1.4.1-beta-b14, mixed mode)
A DESCRIPTION OF THE PROBLEM :
JTable does not takes keyboard entered value when clicking on
other component after input.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.Click on the first table cell
2.Enter "abc"
3.Click on button "jButton1"
4.The value "abc" disappear from the table.
Note that after step 2, click on other cell of the table,
and the value "abc" will be "accepted" into the table.
EXPECTED VERSUS ACTUAL BEHAVIOR :
The table should takes the value and no enter key or
anything is needed for this.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
/*
* TableTest.java
*
* Created on June 27, 2002, 5:10 PM
*/
/**
*
* @author vy2
*/
public class TableTest extends javax.swing.JFrame {
/** Creates new form TableTest */
public TableTest() {
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jButton1 = new javax.swing.JButton();
getContentPane().setLayout(null);
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
exitForm(evt);
}
});
jTable1.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null},
{null},
{null},
{null}
},
new String [] {
"Title 1"
}
) {
Class[] types = new Class [] {
java.lang.Object.class
};
public Class getColumnClass(int columnIndex) {
return types [columnIndex];
}
});
jScrollPane1.setViewportView(jTable1);
getContentPane().add(jScrollPane1);
jScrollPane1.setBounds(30, 20, 475, 210);
jButton1.setText("jButton1");
getContentPane().add(jButton1);
jButton1.setBounds(70, 275, 81, 26);
pack();
java.awt.Dimension screenSize =
java.awt.Toolkit.getDefaultToolkit().getScreenSize();
setSize(new java.awt.Dimension(800, 600));
setLocation((screenSize.width-800)/2,(screenSize.height-600)/2);
}
/** Exit the Application */
private void exitForm(java.awt.event.WindowEvent evt) {
System.exit(0);
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
new TableTest().show();
}
// Variables declaration - do not modify
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable jTable1;
private javax.swing.JButton jButton1;
// End of variables declaration
}
---------- END SOURCE ----------
CUSTOMER WORKAROUND :
Press enter after enter the value, or click inside the table.
Release Regression From : 1.3.1_03
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Review ID: 158595)
======================================================================
- duplicates
-
JDK-4677999 REGRESSION: Data not stored in TableModel when focus lost from JTable
-
- Closed
-
-
JDK-6349059 JTable does not stop cell editing when it loses focus
-
- Closed
-
- relates to
-
JDK-4330950 Lost newly entered data in the cell when resizing column width
-
- Closed
-
-
JDK-5007652 JComboBox in JTable not closed correctly
-
- Closed
-
-
JDK-4503845 Cell editing does not complete when JTable loses focus
-
- Closed
-
-
JDK-4372105 When edditing cell in JTable, the cell have to lose focus to accept changes.
-
- Closed
-
-
JDK-4724980 JTable: Add API to control what happens to edits when table loses focus.
-
- Open
-