Results 1 to 2 of 2
- 03-28-2011, 12:39 PM #1Member
- Join Date
- Mar 2011
- Rep Power
Place a working checkbox in a JTable header.
I have a need (well, mostly aesthetic, so other solutions might work out fine too) to place working comboboxes within the header of a JTable.
This far I managed to create a custom renderer, so I can place even a whole JPanel (containing a checkbox) inside a certain cell of the TableHeader.
The problem right now, though, is that such checkbox, will not really get any input (ie. I can't set it to selected/checked). I suppose that might be as the header's own mouselisteners take over the checkbox ones.
I thought of just stripping off the header's mouselistener, and re-adding some for the checkbox itself, but I can't really find out how to access the checkbox living inside the header :(
Would anyone be so nice as to point me in the right direction from here?
If this is not the right direction at all, what could also help, is some hint on how I could place components, such as checkboxes, on TOP of a tableheader, meaning, render the checboxes in the foreground and have the tableheader stay in the background, which this far I didn't manage to do.
This said, I'm using absolute layout for the panel that contains all of the above.
This is my first post, so, sorry if my description is insufficient or lame, if that's the case I'll try and do better next time :).
- 03-28-2011, 01:39 PM #2
- By pink123 in forum AWT / SwingReplies: 8Last Post: 03-24-2011, 06:29 PM
- By pratim in forum AWT / SwingReplies: 6Last Post: 03-23-2011, 10:43 AM
- By bircastri in forum AWT / SwingReplies: 1Last Post: 11-15-2010, 11:26 AM
- By nikosa in forum AWT / SwingReplies: 1Last Post: 08-05-2009, 05:01 AM
- By bbq in forum AWT / SwingReplies: 1Last Post: 07-05-2007, 04:11 AM