publicstaticvoid main(String[] args) throws Exception { final bug4275046 test = new bug4275046();
test.test();
}
public bug4275046() throws AWTException {
robot = new Robot();
robot.setAutoDelay(100);
}
privatevoid createGUI() {
frame = new JFrame("bug4275046");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JComboBox<Object> cb = new JComboBox<>( new Object[] {"blue", "yellow", "green", "red"});
cb.setEditable(true);
DefaultCellEditor comboEditor = new DefaultCellEditor(cb);
comboEditor.setClickCountToStart(1);
DefaultTableModel model = new DefaultTableModel(data, colNames);
table = new JTable(model);
table.getColumnModel().getColumn(1).setCellEditor(comboEditor);
privatevoid checkResult() throws Exception {
robot.waitForIdle();
SwingUtilities.invokeAndWait(new Runnable() {
@Override publicvoid run() { // Read the edited value of from the cell
editedValue = table.getModel().getValueAt(0, 1);
editedValue = ((String)editedValue).toLowerCase();
System.out.println("The edited value is = " + editedValue);
testResult = editedValue.equals(EXPECTED_VALUE); if (testResult) {
System.out.println("Test passed");
} else {
System.out.println("Test failed");
}
}
}); if (!testResult) { thrownew RuntimeException("Expected value in the cell: '" +
EXPECTED_VALUE + "' but found '" + editedValue + "'.");
}
}
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.10Bemerkung:
(vorverarbeitet am 2026-06-10)
¤