Overwritten Boolean in table cell



Hi guys,
I'm using Swing to create a JTable with one column rendering a checkbox
(Boolean). Fine, this works because I have a custom table model that
overrides getColumnClass() and now everybody is happy figuring out how to
render a Boolean.

Now I'm not happy with white background so I create a new renderer class,
and I myTable.setDefaultRenderer(Boolean.class, new BooleanClassRenderer().
Fine, now I get my pretty color background.

But ....... (the big but) that pretty background overwrites the checkbox
which is now hidden until you use the editor to MouseDown on the cell. Then
the checkbox appears visible until you MouseUp.

How is this happening and how can I prevent it? I've tried a number of
things like new Boolean(true) in the renderer *after* setting the
background. This has me stumped and I don't know where to look for help.

Any ideas?


.



Relevant Pages

  • Re: Default JTree Icons
    ... For the most part, the renderer works. ... out how to set my own icon during the editing process. ... public class RollupTree extends JTree implements Mediatable { ... private boolean _mediated = true; ...
    (comp.lang.java.gui)
  • Re: How to determine what caused OnClick event for checbox
    ... procedure SetData1(const Value: Boolean); ... property IsUpdating: Boolean read GetIsUpdating; ... Data1 might be shown to the user as a checkbox, ... FUpdateLevel is the nesting level of Begin/EndUpdate calls. ...
    (alt.comp.lang.borland-delphi)
  • Re: Boolean data type
    ... How are Boolean values implemented now? ... Format the field to use this Value List, and make it a Checkbox ... (technically radio buttons can't be turned "off" by simply clicking on ... two / three separate single value fields. ...
    (comp.databases.filemaker)
  • Re: Boolean data type
    ... I bought 'The Missing Manual' and am working my way through. ... How are Boolean values implemented now? ... Format the field to use this Value List, and make it a Checkbox ... (technically radio buttons can't be turned "off" by simply clicking on ...
    (comp.databases.filemaker)
  • Re: Boolean Cell Renderer Question
    ... Boolean cell renderer displays (the checkbox only), changes, and when ... my renderer displays with the correct icon ... I then decided to create a custom Boolean cell renderer by copying ... the code from JTable$BooleanRenderer that only added a label to the ...
    (comp.lang.java.gui)