Name: akC57697 Date: 08/19/98
The JCK tests
api/com_sun_java/swing/JTable/manual.html#edit failed
under JDK1.2fcsF. The test passed under JDK1.2beta4.
Output:
"
====== JTable3024 ====== public void boolean editCellAt(int,int,EventObject).
The event that isCellEditable() has been obtained is
com.sun.java.swing.event.ChangeEvent[source=
com.sun.java.swing.JTable[,0,0,0x0,invalid,alignmentX=null,
alignmentY=null,border=,flags=32,maximumSize=,minimumSize=,preferredSize=,
autoCreateColumnsFromModel=true,autoResizeMode=AUTO_RESIZE_SUBSEQUENT_COLUMNS,
cellSelectionEnabled=false,editingColumn=0,editingRow=0,gridColor=
com.sun.java.swing.plaf.ColorUIResource[r=153,g=153,b=153],
preferredViewportSize=java.awt.Dimension[width=450,height=400],rowHeight=16,
rowMargin=1,rowSelectionAllowed=true,selectionBackground=
com.sun.java.swing.plaf.ColorUIResource[r=204,g=204,b=255],
selectionForeground=com.sun.java.swing.plaf.ColorUIResource[r=0,g=0,b=0],
showHorizontalLines=true,showVerticalLines=true]]
The event that shouldSelectCell() has been obtained is null
JTable3024: Failed. Methods have not been invoked properly
STATUS:Failed. tests: 2; passed: 1; failed: 1; first test case failure: JTable3024
Total tests:2
"
The doc for editCellAt(..) has not been changed since jdk1.2beta4:
"
public boolean editCellAt(int row, int column, EventObject e)
* Programmatically starts editing the cell at <I>row</I> and
* <I>column</I>, if the cell is editable.
* To prevent the JTable from editing a particular table, column or
* cell value, return false from the isCellEditable() method in the
* TableModel interface.
*
* @param row the row to be edited
* @param column the column to be edited
* @param e event to pass into
* shouldSelectCell
^^^^^^^^^^^^^^^^^^^^^^
* @exception IllegalArgumentException If <I>row</I> or <I>column</I>
* are not in the valid range
* @return false if for any reason the cell cannot be edited.
"
The reason is that the invokation of shouldSelectCell() has been removed , see diff:
2c2
< * @(#)JTable.java 1.106 98/08/07
---
> * @(#)JTable.java 1.84 98/05/18
PENDING(philip)
2022a1821,1823
> // PENDING: this could convert event at this point!
> boolean shouldSelect = editor.shouldSelectCell(e);
>
2027a1829
======================================================================