Menu

#73 JTable - JComboBox as default cell editor problems

open
nobody
None
5
2014-12-15
2005-09-06
Kamal Nazar
No

I am having trouble with JFCUnit 2.08 running on
Windows2000 with JDK1.4_05 - in particular,
manipulating a JTable
where the default-call-renderer is a JComboBox - I am
using JComboBoxMouseEventData - and retrieving the
cell-renderer instance (see code below) - am also using
flushAWT after posting events.

invoking the code below (am sure there are no
IllegalArgumentExceptions throw by the underlying
JComboBox - i.e. the
selection index specified is legal) - there are absolutely
no exceptions thrown when this code is executed -
and the user-interface does not respond in any way !!

public void selectTableEntry(Integer parentOrChild, int
row, int coll, int itemIndex ){
JTable table = this.getRequiredTable();
Component editorComp = getEditorComponent
(table, row, coll);
JComboBoxMouseEventData comboEvent = new
JComboBoxMouseEventData(testCase, (JComboBox)
editorComp, itemIndex, 1);
comboEvent.prepareComponent();
comboEvent.setElementIndex(itemIndex);
testCase.flushAWT();
testHelper.enterClickAndLeave(comboEvent);
testCase.flushAWT();
}

Has anyone had suimilar problems - I have seen some
related posts and have tried their suggested
workarounds - i.e.
using JFCTestCase.setHelper(...) to set the helper
explicitly - and even using WindowMonitor.start();
before any windows/dialogs
are created (although this seems a long shot as its
related to DialogFinder).

Any help greatly appreciated

Discussion


Log in to post a comment.