Reputation: 199
I'm just stepping into this huge world of designing graphic UIs, so please be patient.
I went through (some of) the (vast) documentation on the official website and I just wanted to know if there was a method that told me the shape of my JComponent.
When I do getBounds it says rectangle, does this refer to my shape?
Thanks in advance.
Upvotes: 2
Views: 34
Reputation: 10147
AWT's class Component
and Swing's class JComponent
don't have the concept
of arbitrary shapes, they just have a rectangular shape.
That's why JComponent
's method getBounds
returns a Rectangle
which is just a special case of the Shape
interface.
Only class java.awt.Window
has getShape
and setShape
methods,
and of course all its subclasses (Dialog
, Frame
, JWindow
, JDialog
, JFrame
, ...) also have. May be this is what you need.
Upvotes: 2