I would like to have the editor in my editable JTables select all text in the cell when starting to edit. I have tried a couple of things that all revolve around calling JT
The Table Select All Editor should work for you. It is the preferred solution so you don't have to keep creating custom editors. That is the columns containing integers should only accept integers. With you current code
Your code does work partially. If you start editing using the F2 key, then the text is selected. However, when you use the mouse and double click on the cell then the second mouse event is passed to the editor so the caret can be positioned where you clicked and this removes the selection. A solution for this is:
final JTextComponent jtc = (JTextComponent)c;
jtc.requestFocus();
//jtc.selectAll();
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
jtc.selectAll();
}
});