1
I have the String for a combobox item, but when the user clicks on the table, the combobox should automatically select the category for that particular item. However, I found that there is no getIndex of function as I put below. How can I recover the index to use of this string?
private void TabelaMouseClicked(java.awt.event.MouseEvent evt) {
// Click na tabela para selecionar produto:
if (Tabela.getSelectedRow() != -1){
txt_descricao.setText(Tabela.getValueAt(Tabela.getSelectedRow(), 1).toString());
cb_marca.getIndexOf("teste");
}
}
I do not have the entry of the item only have what it is worth example
– Gabriel Ribeiro
Item1, Item2, Item3 - I need something like this: getIndexOf("Item2) and this should return me the number 1 that would be the entry of this item
– Gabriel Ribeiro
@Gabrielribeiro his combo features a custom comboboxmodel?
– user28595
I’m using the dafault model of combobox
– Gabriel Ribeiro
@Gabrielribeiro see the edition.
– user28595
Now it’s worked out Thank you very much
– Gabriel Ribeiro
Google’s ranking algorithm is based on links. Therefore, I suggest only put links to Javadoc from Java 9 from now on and update the old ones too, so that everyone falls into the newest references and google puts it higher up on the old ones.
– Victor Stafusa
The link to
getIndexOf
is pointing to something that is not thegetIndexOf
– Jefferson Quesado