Adding JComboBox to JTable - java

I'm creating a JTable in Java & I'm asked to add to the table a JCheckBox, JButton and a JComboBox. The table that I created is displaying all the information, the button is working fine and the JCheckBox is also working, the problem I'm facing is that the JComboBox is not working. I really can't figure out why. I've tried to look the problem up but I can't figure it out. Can someone help me please?
The code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
public class sinX extends JFrame {
private JTable table;
private DefaultTableModel model;
private Object[][] data;
private String[] columnNames;
private JButton button;
JComboBox comboBox;
public sinX() {
comboBox = new JComboBox();
setTitle("Programming Languages");
data = new Object[][]{{"C","Dennis Ritchie",1972,false},{"C++","Bjarne Stroustrup",1983,true},
{"Python","Guido van Rossum",1991,false},{"Java","James Gosling",1995,true},{
"JavaScript","Brendan Eich",1995,true},{"C#","Anders Hejlsberg",2001,false},
{"Scala","Martin Odersky",2003,true}};
columnNames = new String[] {"Language","Author","Year","Check Box"};
//model = new DefaultTableModel(data, columnNames);
//table = new JTable(model);
//table.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
final Class[] columnClass = new Class[] {
String.class, String.class, Integer.class, Boolean.class
};
//create table model with data
DefaultTableModel model = new DefaultTableModel(data, columnNames) {
#Override
public boolean isCellEditable(int row, int column)
{
return false;
}
#Override
public Class<?> getColumnClass(int columnIndex)
{
return columnClass[columnIndex];
}
};
table = new JTable(model);
table.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
button = new JButton("Remove");
button.addActionListener(new ActionListener() {
#Override
public void actionPerformed(ActionEvent ae) {
// check for selected row first
if(table.getSelectedRow() != -1) {
// remove selected row from the model
model.removeRow(table.getSelectedRow());
JOptionPane.showMessageDialog(null, "Selected row deleted successfully");
}
}
});
TableColumn year = table.getColumnModel().getColumn(2);
comboBox.addItem("A");
comboBox.addItem("B");
comboBox.addItem("C");
comboBox.addItem("D");
year.setCellEditor(new DefaultCellEditor(comboBox));
add(new JScrollPane(table), BorderLayout.CENTER);
add(button, BorderLayout.SOUTH);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(600, 500);
setLocationRelativeTo(null);
setVisible(true);
}
public static void main(String args[]) {
new sinX();
}
}

the problem I'm facing is that the JComboBox is not working.
year.setCellEditor(new DefaultCellEditor(comboBox));
The above code indicates you are trying to use a combo box as an editor for the given column.
public boolean isCellEditable(int row, int column)
{
return false;
}
However, you have stated in your model that none of columns are editable.
You need to return true for any column where you want to edit the data.
the JCheckBox is also working
Not really. Yes you see the boolean value is rendered as a check box. However, you can't change its value by clicking on it, unless of course you return true for that column as well.

Related

Showing Old Value in JTable in swing

In this code block I'm getting old values after clicking inside scroll pane, however new values also disappear at first on fetching but they slowly disappear and old values appear in that place.
I tried a few combinations but was't able to achieve the results as expected. Also during variable declaration I made all the variables as non-static except the frame which I suppose is not relevant and recommended and I'm also embedding the components on frame itself.
//THE TABLE
table = new JTable();
//THE COLUMN
String[] columns = new String[] {
"Serial No", "BundleId", "Bundle Count", "Record Count","Status","Date"
};
//THE ROW
Object[][] data = dc.Success(date,afterDate);
final Class[] columnClass = new Class[] {
Boolean.class,String.class, String.class, String.class,String.class,String.class };
//create table model with data
DefaultTableModel model = new DefaultTableModel(data, columns) {
#Override
public boolean isCellEditable(int row, int column)
{
return false;
}
#Override
public Class<?> getColumnClass(int columnIndex)
{
return columnClass[columnIndex];
}
public Object getCellEditorValue() {
return "";
}
};
// JTable table = new JTable(model);
table.setModel(model);
//add the table to the frame
//ADD SCROLLPANE
scroll.setBounds(70, 80, 600, 400);
scroll.setViewportView(table);
frame.getContentPane().add(scroll);
// this.add(new JScrollPane(table));
// table.setAutoCreateRowSorter(true);
table.setPreferredScrollableViewportSize(new Dimension(320, 160));
TableColumn tc = table.getColumnModel().getColumn(BOOLEAN_COL);
tc.setHeaderRenderer(new SelectAllHeader(table, BOOLEAN_COL));
this.setTitle("Table Example");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.pack();
this.setVisible(true);
table.repaint();
If you want to notify your JTable about changes of your data, use something similar to tableModel.fireTableDataChanged().
There are other methods that can be used for updating specific ranges of data. tableModel.fireTableRowsUpdated​(firstRow, lastRow) might be of particular use to you. This is because you suggest you only update a single row when that row is clicked on. If that is not the case, stick to tableModel.fireTableDataChanged().
From your comments, I notice you are trying to fire a data change event and then changing your whole model anyway. This is not required and could actually be the source of your issues if your model is holding the old values.
Instead you should change the DataVector of the current model. To change the data on a single row you could use something like the following extract of code. There is a full example below the extract.
//Get your row's values from your database
//I'll use random values for this purpose
int col1Val = getRand(0, 9);
int col2Val = getRand(0, 9);
//Put the values in an object vector
Vector<Object> rowVals = new Vector<>();
rowVals.addElement(col1Val);
rowVals.addElement(col2Val);
//Set the object vector
model.getDataVector().setElementAt(rowVals, table.getSelectedRow());
//Notify the table the row has changed
model.fireTableRowsUpdated(table.getSelectedRow(), table.getSelectedRow());
Full example
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.GridLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Vector;
import java.util.concurrent.ThreadLocalRandom;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
public class JTableExample extends JFrame {
private static final String windowName = "JTable Example";
private static final long serialVersionUID = 362702020844358278L;
private JPanel tablePanel;
private JScrollPane scrollPanel;
private JTable table;
private DefaultTableModel model;
private JTableExample() {
super(windowName);
SetUp();
}
private void SetUp() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
SetUpJTable();
SetUpJPanel();
add(tablePanel);
pack();
setVisible(true);
}
private void SetUpJPanel() {
tablePanel = new JPanel(new GridLayout());
tablePanel.add(scrollPanel);
}
private void SetUpJTable() {
String[] columns = new String[] {
"Something", "Something Else"
};
String[][] data = new String[][] {
{"1", "2"},
{"3", "3"}
};
model = new DefaultTableModel(data, columns) {
private static final long serialVersionUID = -3895234084030399437L;
#Override
public boolean isCellEditable(int row, int column)
{
return false;
}
};
table = new JTable(model);
table.addMouseListener(new MouseAdapter() {
#Override
public void mouseClicked(MouseEvent e) {
//Get your row's values from your database
//I'll use random values for this purpose
int col1Val = getRand(0, 9);
int col2Val = getRand(0, 9);
//Put the values in an object vector
Vector<Object> rowVals = new Vector<>();
rowVals.addElement(col1Val);
rowVals.addElement(col2Val);
//Set the object vector
model.getDataVector().setElementAt(rowVals, table.getSelectedRow());
//Notify the table the row has changed
model.fireTableRowsUpdated(table.getSelectedRow(), table.getSelectedRow());
}
});
scrollPanel = new JScrollPane(table);
scrollPanel.setPreferredSize(new Dimension(500, 500));
}
private static int getRand(int min, int max) {
return ThreadLocalRandom.current().nextInt(min, max + 1);
}
public static void main(String[] args) {
EventQueue.invokeLater(() -> new JTableExample());
}
}

JTable selection listener

I have a code which displays Table in applets & consists of two columns:-
image icon
description
Here's my code:
import javax.swing.table.*;
public class TableIcon extends JFrame
{
public TableIcon()
{
ImageIcon aboutIcon = new ImageIcon("about16.gif");
ImageIcon addIcon = new ImageIcon("add16.gif");
ImageIcon copyIcon = new ImageIcon("copy16.gif");
String[] columnNames = {"Picture", "Description"};
Object[][] data =
{
{aboutIcon, "About"},
{addIcon, "Add"},
{copyIcon, "Copy"},
};
DefaultTableModel model = new DefaultTableModel(data, columnNames);
JTable table = new JTable( model )
{
// Returning the Class of each column will allow different
// renderers to be used based on Class
public Class getColumnClass(int column)
{
return getValueAt(0, column).getClass();
}
};
table.setPreferredScrollableViewportSize(table.getPreferredSize());
JScrollPane scrollPane = new JScrollPane( table );
getContentPane().add( scrollPane );
}
public static void main(String[] args)
{
TableIcon frame = new TableIcon();
frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
frame.pack();
frame.setVisible(true);
}
}
Now what i want to know is how can I implement selection listener or mouse listener event on my table , such that it should select a particular image from my table and display on text area or text field(my table contains path of image file)?
Can I add text field on table & table on frame? Please feel free to ask queries if required.
In my code I have a table where I set single selection mode; in my case, listener described in How to Write a List Selection Listener (with a for loop from getMinSelectionIndex to getMaxSelectionIndex) is not useful because releasing mouse button I'm sure I have just one row selected.
So I've solved as follows:
....
int iSelectedIndex =-1;
....
JTable jtable = new JTable(tableModel); // tableModel defined elsewhere
jtable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
ListSelectionModel selectionModel = jtable.getSelectionModel();
selectionModel.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
handleSelectionEvent(e);
}
});
....
protected void handleSelectionEvent(ListSelectionEvent e) {
if (e.getValueIsAdjusting())
return;
// e.getSource() returns an object like this
// javax.swing.DefaultListSelectionModel 1052752867 ={11}
// where 11 is the index of selected element when mouse button is released
String strSource= e.getSource().toString();
int start = strSource.indexOf("{")+1,
stop = strSource.length()-1;
iSelectedIndex = Integer.parseInt(strSource.substring(start, stop));
}
I think this solution, that does not require a for loop between start and stop to check which element is selectes, is more suitable when table is in single selection mode
How about this?
protected void handleSelectionEvent(ListSelectionEvent e) {
if (e.getValueIsAdjusting())
return;
final DefaultListSelectionModel target = (DefaultListSelectionModel)e.getSource();
iSelectedIndex = target.getAnchorSelectionIndex();
}
Read the section from the Swing tutorial on How to Write a List Selection Listener.
You can't add a text field to the table, but you can add a textfield and a table to the same frame.

Accessing a JTextField in JTableHeader

I have made a TableHeader renderer that will create a JTextfield under the Label of the header in a JTable.
The problem i got now, i never get focus/access to this JTextfield in the header.
I found out that a TableHeader renderer only draws the component and dont do the rest, like focus and stuff.
I have tryed to make a array of JTextfield that will set on the header, so i can access them on code base. Unlucky that didnt workout, i was wondering if its possible to get access to this JTextField in the header and what is the best way to do this.
Tableheader renderer:
public class TextFieldTableHeaderRenderer extends AbstractCellEditor implements TableCellRenderer {
private MyPanel component;
public TextFieldTableHeaderRenderer(){
}
#Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
component = new MyPanel(column);
((MyPanel)component).setLabelText(value.toString());
return component;
}
#Override
public Object getCellEditorValue() {
return ((MyPanel)component).getTextField();
}
MyPanel:
public class MyPanel extends JPanel {
private javax.swing.JLabel label;
private javax.swing.JTextField textField;
public MyPanel(int column) {
super();
setLayout(new java.awt.BorderLayout());
label = new javax.swing.JLabel();
textField = new javax.swing.JTextField();
setBorder(javax.swing.BorderFactory.createEtchedBorder());
label.setHorizontalAlignment(SwingConstants.CENTER);
//textField.setText("Column "+column);
add(textField, java.awt.BorderLayout.PAGE_END);
add(label, java.awt.BorderLayout.CENTER);
}
public void setLabelText( String text ){
label.setText(text);
}
public void setTextFieldText(String text){
getTextField().setText(text);
}
public javax.swing.JTextField getTextField() {
return textField;
}
/**
* #param textField the textField to set
*/
public void setTextField(javax.swing.JTextField textField) {
this.textField = textField;
}
Install on header:
for( int i=0; i < this.getxColumnModel().getColumnCount(); i++){
this.getxColumnModel().getColumn(i, true).setHeaderRenderer( new TextFieldTableHeaderRenderer() );
}
I have try to use the "EditableHeader" example from the i-net, but it makes a new JTextfield when clicking on the header.
I like to see that the user get focus on the JTextfield, enters a text and then it will filter the column.
Filtering wont be a problem, cause i have made that already.
Hopefully im clear to you guys/girls and love to hear you solution
Here's a simple approach for making editable headers:
EDIT: oops - I meant to post this in another thread. I guess I'll keep it here anyway.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.table.*;
public class JTableEditableHeaderDemo implements Runnable
{
private JTable table;
private JTableHeader header;
private JPopupMenu renamePopup;
private JTextField text;
private TableColumn column;
public static void main(String[] args)
{
SwingUtilities.invokeLater(new JTableEditableHeaderDemo());
}
public JTableEditableHeaderDemo()
{
table = new JTable(10, 5);
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
table.setPreferredScrollableViewportSize(table.getPreferredSize());
header = table.getTableHeader();
header.addMouseListener(new MouseAdapter(){
#Override
public void mouseClicked(MouseEvent event)
{
if (event.getClickCount() == 2)
{
editColumnAt(event.getPoint());
}
}
});
text = new JTextField();
text.setBorder(null);
text.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
renameColumn();
}
});
renamePopup = new JPopupMenu();
renamePopup.setBorder(new MatteBorder(0, 1, 1, 1, Color.DARK_GRAY));
renamePopup.add(text);
}
public void run()
{
JFrame f = new JFrame("Double-click header to edit");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(new JScrollPane(table));
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
}
private void editColumnAt(Point p)
{
int columnIndex = header.columnAtPoint(p);
if (columnIndex != -1)
{
column = header.getColumnModel().getColumn(columnIndex);
Rectangle columnRectangle = header.getHeaderRect(columnIndex);
text.setText(column.getHeaderValue().toString());
renamePopup.setPreferredSize(
new Dimension(columnRectangle.width, columnRectangle.height - 1));
renamePopup.show(header, columnRectangle.x, 0);
text.requestFocusInWindow();
text.selectAll();
}
}
private void renameColumn()
{
column.setHeaderValue(text.getText());
renamePopup.setVisible(false);
header.repaint();
}
}
TableColumn supports setting a TableCellRenderer via setHeaderRenderer(), as shown in this example; it has no provision for setHeaderEditor(), which would be required for editing. Alternatives might include these:
Write a custom JTableHeader.
Add a row of text fields in an adjacent, conformal layout.
Use a particular row in the TableModel, as suggested in FixedRowExample.
Consider a commercial alternative; several are listed here.

save Jtable data when savebutton is pressed

I want to save Name and value of jtable into two variable
public class NewClass extends JPanel implements TableModelListener {
private final String[] columnNames = { "Name", "Value","check"};
private JTable table;
private DefaultTableModel tableModel;
private final JButton buttonSave;
public NewClass(){
tableModel = new DefaultTableModel(columnNames, 0);
tableModel.addTableModelListener(this);
table = new JTable(tableModel);
javax.swing.table.TableColumn var_col;
var_col = table.getColumnModel().getColumn(2);
final JCheckBox check = new JCheckBox();
var_col.setCellEditor(new DefaultCellEditor(check));
var_col.setCellRenderer(new DefaultTableCellRenderer() {
#Override
public Component getTableCellRendererComponent(JTable table,
Object value, boolean isSelected, boolean hasFocus, int row, int
column) {
check.setSelected(((Boolean)value).booleanValue()) ;
return check;
}
});
JScrollPane scrollPane = new JScrollPane(table);
setLayout(new BorderLayout());
setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
add(BorderLayout.NORTH, new JLabel("Mon panier", JLabel.CENTER));
add(BorderLayout.CENTER, scrollPane);
//--------I want to save these Name and value in two variables -----------
Object[] data1 = {
new String("work"), new String("done"),new Boolean(false)};
tableModel.addRow(data1);
buttonSave = new JButton("Save");
buttonSave.setEnabled(false);
buttonSave.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ev) {
buttonSave.setEnabled(false);
}
});
As discussed in How to Use Tables, your table's data should be managed by a TableModel such as AbstractTableModel or the concrete DefaultTableModel used in your example. In this example, DataModel extends AbstractTableModel and synthesizes a List<Value> of test data; yours would listen to whatever object monitors the serial port. The example also uses the class Value to encapsulate a selectable numeric value. The custom TableCellEditor updates each Value as it is changed, so the DataModel always contains the selection state of each element in the list. Your save button could then save the list elements in whatever format you prefer.

Losing first character in JTable panel based cell editor

I have a cell editor that contains a little button and then a textfield that can be used to edit the value inline
I use setSurrendersFocusOnKeystroke(true) and a focus listener in order to allow a user to start editing immediately from the keyboard, but the trouble is the fisrt key pressed seems to get consumed rather being added to the text field, how can I prevent this ?
Full self contained example below
import javax.swing.*;
import java.awt.*;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
public class PanelTableEditorTest extends JFrame {
private JTable table;
public PanelTableEditorTest() {
this.setLayout(new BorderLayout());
table = new JTable(10, 10);
table.getSelectionModel().setSelectionMode(
ListSelectionModel.SINGLE_SELECTION);
table.setCellSelectionEnabled(true);
table.setDefaultEditor(Object.class, new SimpleMultiRowCellEditor());
table.setSurrendersFocusOnKeystroke(true);
table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F2, 0),
"none");
table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
.put(KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ENTER, 0),
"startEditing");
this.add(table.getTableHeader(), BorderLayout.NORTH);
this.add(table, BorderLayout.CENTER);
pack();
setVisible(true);
}
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
new PanelTableEditorTest();
}
});
}
public class SimpleMultiRowCellEditor extends DefaultCellEditor {
final JPanel panel;
private final JButton rowCount;
public SimpleMultiRowCellEditor() {
super(new JTextField());
this.setClickCountToStart(1);
rowCount = new JButton();
rowCount.setVisible(true);
panel = new JPanel();
panel.setOpaque(false);
panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
panel.add(rowCount);
panel.add(editorComponent);
panel.addFocusListener(new PanelFocusListener());
}
public Component getTableCellEditorComponent(
final JTable table,final Object val, final boolean isSelected,
final int row, final int column) {
rowCount.setText("1");
delegate.setValue(val);
editorComponent.requestFocusInWindow();
return panel;
}
class PanelFocusListener implements FocusListener {
public void focusGained(FocusEvent e) {
editorComponent.requestFocusInWindow();
}
public void focusLost(FocusEvent e) {
}
}
}
}
So I have found a solution, thanks to this article http://jroller.com/santhosh/entry/keyboard_handling_in_tablecelleditor , and some useful discussion abou this and how it can be applied to other components at http://forums.java.net/jive/thread.jspa?messageID=482236&#482236
Don't fully understand the solution this whole area seems to be rather a minefield
I've also added this solution Get correct editing behaviour in JTable using java DefaultCellEditor into this so that when you start editing a field using the keyboard the existing value is replaced, but not when you double click o the field.
My one confusion is that I'm not receiving a Key Event as I'd expect but just null so I've had to account for that.
Ive gone back from using setSurrenderKeystrokes(true) because this causes problems with others editors such as the straightforward textfieldeditor
import javax.swing.*;
import javax.swing.text.Caret;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.util.EventObject;
public class PanelTableEditorTest extends JFrame
{
private JTable table;
public PanelTableEditorTest()
{
try
{
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch(Exception e)
{
}
this.setLayout(new BorderLayout());
table = new JTable(4, 4);
table.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
table.setCellSelectionEnabled(true);
table.setSurrendersFocusOnKeystroke(false);
table.setDefaultEditor(Object.class,new SimpleMultiRowCellEditor());
table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(java.awt.event.
KeyEvent.VK_F2, 0), "none");
table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(java.awt.event.
KeyEvent.VK_ENTER, 0), "startEditing");
this.add(table.getTableHeader(), BorderLayout.NORTH);
this.add(table, BorderLayout.CENTER);
pack();
setVisible(true);
}
public static void main(String[] args)
{
EventQueue.invokeLater(new Runnable()
{
public void run()
{
new PanelTableEditorTest();
}
});
}
public class SimpleMultiRowCellEditor extends DefaultCellEditor
{
private EventObject event;
final JPanel panel;
private final JButton rowCount;
public SimpleMultiRowCellEditor()
{
super(new JTextField());
this.setClickCountToStart(1);
rowCount = new JButton();
rowCount.setVisible(true);
panel = new TableEditorPanel();
panel.setRequestFocusEnabled(true);
panel.setOpaque(false);
panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
panel.add(rowCount);
panel.add(editorComponent);
}
public boolean isCellEditable(EventObject anEvent)
{
event=anEvent;
return super.isCellEditable(anEvent);
}
public Component getTableCellEditorComponent(final JTable table, final Object val, final boolean isSelected, final int row, final int column)
{
rowCount.setText("1");
delegate.setValue(val);
if(event instanceof KeyEvent || event==null)
{
final Caret caret = ((JTextField)editorComponent).getCaret();
caret.setDot(0);
((JTextField)editorComponent).setText("");
}
return panel;
}
class TableEditorPanel extends JPanel
{
public void addNotify(){
super.addNotify();
editorComponent.requestFocus();
}
protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed){
InputMap map = editorComponent.getInputMap(condition);
ActionMap am = editorComponent.getActionMap();
if(map!=null && am!=null && isEnabled()){
Object binding = map.get(ks);
Action action = (binding==null) ? null : am.get(binding);
if(action!=null){
return SwingUtilities.notifyAction(action, ks, e, editorComponent,
e.getModifiers());
}
}
return false;
}
}
}
}
add a
rowCount.setFocusable(false);
in the SimpleMultiRowCellEditor constructor, to prevent the button to retrieve focus, so that the JTextfield is the only how can have the focus on cell edition

Categories

Resources