Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Force popup of combobox with spacebar

 
Sven Goetgeluck
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I've got a JTable with one cell as jcombo editor, i want to force the combobox to go to edit mode (and also popup) wit pressing the space bar instead of use F2.


public class MyTableComboEditor extends DefaultCellEditor {

private static final long serialVersionUID = 1L;
public MyTableComboEditor(JComboBox combo) {
super(combo);
setClickCountToStart(2);
}

public MyTableComboEditor(JTextField tf) {
super(tf);
setClickCountToStart(2);
}

public void setClickCountToStart(int count) {
super.setClickCountToStart(count);
}


}



with regards
Sven
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will have to tweak the Key Bindings to achieve the desired result.

I hope the combo box is not editable as trying to enter "some value" will trigger the combo popup or worse.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!