Re: How many warnings is too many?



ricky.clarkson@xxxxxxxxx wrote:
Thomas,

For normal uses
there is no point extending JPanel. But banning a component extending
JComponent is absurd.


To my eyes, the main difference between JPanel and JComponent is that
JPanel is opaque by default.  I might have missed something.  So I will

You are apparently not alone in missing something. JPanel is not guaranteed to be opaque by default. It is PL&F dependent. For my machine the PL&F that matches the common native look & feel may or may not set JPanels to opaque depending upon which version of Java I use.


http://java.sun.com/docs/books/tutorial/uiswing/components/toplevel.html#contentpane

Tom Hawtin
--
Unemployed English Java programmer
http://jroller.com/page/tackline/
.



Relevant Pages

  • Re: Whats the swing equivalent for Canvas?
    ... > In the following program I use JPanel to perform painting. ... The error is that because MyPanel components are opaque, by default, the ... invoke super.paintComponentin the paintComponentmethod ...
    (comp.lang.java.gui)
  • Re: Whats the swing equivalent for Canvas?
    ... >> In the following program I use JPanel to perform painting. ... > The error is that because MyPanel components are opaque, by default, the ... > - invoke super.paintComponentin the paintComponentmethod ...
    (comp.lang.java.gui)
  • Re: Whats the swing equivalent for Canvas?
    ... >> In the following program I use JPanel to perform painting. ... > The error is that because MyPanel components are opaque, by default, the ... > - invoke super.paintComponentin the paintComponentmethod ...
    (comp.lang.java.gui)