Question

I have code like this:

//(...)
JTableFixture myTreeTable = frame.table(matcher);

If I try to obtain JCellFixtures or values or contents, everything is null. I am only obtaining the number of rows or columns. JTable internally uses a CellRendererPanel which I guess I have to fetch. But how? JTable has no ContainerFixture to make .panel(). Is there any way to get the cell values in these circumstances? How it is usually done when there is a cell renderer panel?

This is the hierarchy for the FEST debugger:

gui.treetable.myTreeTable[name=null, rowCount=33, columnCount=2, enabled=true, visible=true, showing=true]
   javax.swing.CellRendererPane[,0,0,0x0,hidden]
Was it helpful?

Solution

If you table has a custom cell renderer you can provide your your own cell reader. Check out Custom Cell Renderers article. It demonstrates how to extend BasicJTableCellReader and how to use the reader in JTableFixture.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top