[Biojava-dev] SequencePannel fixed?

Thomas Down td2@sanger.ac.uk
Thu, 17 Oct 2002 09:06:54 +0100


on Wed, Oct 16, 2002 at 09:45:22PM +0100, Keith James wrote:
> 
> Cool. One thing which needs fixing is that SequencePanel is not
> honouring setOpaque() or setting of background colours. I'm getting
> nasty redraw artefacts with Sun Linux JDK 1.4+ in its current
> "transparent" state.
> 
> As is subclasses JComponent it needs to paint its own background i.e.
> 
>  if (isOpaque())
>  {
>      g2.setPaint(getBackground());
>      g2.fillRect(0, 0, getWidth(), getHeight());
>  }

Sun's recommended way to do this is to call paintComponent
on the superclass before drawing your own stuff.  I guess that's
a nicer way of doing things, since it means that any wierd stuff
in the JPanel UI delegate will be called properly.

     Thomas.