ElishaMoshe
asked on
"Disabled" input when used as a table's header component
I want to change my JTable and add above each column header label a TextField / Combo that will be used for filtering.
I started doing so by implementing a TableCellRenderer and in the
getTableCellRendererCompon ent I am returning a panel with two rows, one for the Input and one for the Label.
It looks good but I could not focus on that input (not with the mouse and not with the keyboard) it's like the input is disabled.
I thought of adding a MouseListener to the input and activate event my selt but they did not work.
How can I do this?
I started doing so by implementing a TableCellRenderer and in the
getTableCellRendererCompon
It looks good but I could not focus on that input (not with the mouse and not with the keyboard) it's like the input is disabled.
I thought of adding a MouseListener to the input and activate event my selt but they did not work.
How can I do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Great work!
1. When you want to edit the text field on the table header, just show a editable text field just on top of the header field( use windo as container? ).
2. When the user type text and press enter, get the text from the editable TF and hide it and then set the text to the header text fields.