last day (14 days later) » 

1:04 PM
0
Q: Simulate Esc key in JTable getTableCellEditorComponent

Ladislav DANKOI need to fire ESC key in code: public class MyEditor extends JRadioButton implements TableCellEditor { public MyEditor() { super(); } @Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { ...

 
@alex2410 in fact, i dont't know. i have jtable with jradiobuttons in cells. works fine (radio button is switching) except the fact that actual state of the jradiobutton is rendered just after i press esc key on keyboard or click on another component.
@alex2410 working example with jradiobutton in table cell should be nice if you know. trying googling but had not found.
 
override override all states for editor, one of them is cancelled
in fact, i dont't know. i have jtable with jradiobuttons in cells. **works fine** (radio button is switching) except the fact that actual state of the jradiobutton is rendered just after i press esc key on keyboard or click on another component. == it doesn't works fine
 
@mKorbel override override all states for editor, one of them is cancelled can you be more concrete, please?
 
1. e.g. usage of cancelCellEditing/fireEditingCanceled by @aterai, 2. search for cancelCellEditing/fireEditingCanceled, 3. there isn't real answer to your question without an SSCCE/MCVE short, runnable, compilable, with hardcoded value for JTable/XxxTableModel in local variable, 4. (I'm strongly suggest to) use JComboBox as DefaultCellEditor and JRadioButton as XxxTableCellRenderer
question in this form should be closed as too_broad, off-topics because - too lazy to search :-)
 
@mKorbel searching two days at the moment but not know what exactly is bad -it's problem when not know where the problem exactly is :-) this is why working example with jradiobuttons in table column should be nice
 
1:04 PM
search for Java + Swing + JTable + JRadioButton here, maybe I'm post something about here, including highlighter on rollover
again without an SSCCE/MCVE short, runnable, compilable, with hardcoded value for JTable/XxxTableModel in local variable isn't answerable here, again to use JComboBox as DefaultCellEditor and JRadioButton as XxxTableCellRenderer in the case that you want to simulating JRadioButton in ButtonGroup (only one JRadioButton can be selected)
Maybe someone will have mercy:-), here are a few users with this nature that ignoring all good rules here
please to add to your question about fact that ESC key is/can be/will be pressed (== Key Bindings) or only about how to do that programatically without any KeyEvents
 
@mKorbel will post soon and update question, not so easy to prepare minimal from actual code. using jcombobox for editor is not a solution, i have column with jradiobuttons and just one should be selected.
@mKorbel will we try chat?
 
i have column with jradiobuttons and just one should be selected == JComboBox as TableCellEditor(will be updated with lint to SSCCE/MCVE) , (to avoid) but is possible to create JRadioButtons in ButtonModel but use only code where is stored boolean value in XxxTableModel for JTables view
 
hi
vidite ma?
pravdupovediac chat som tu na so este nepouzival takze nemam predstavu ci sa vidime :D
 

last day (14 days later) »