Any subclass of Component can call the “setSkin( skin object )” themselves (and 
should) during the constructor.

HTH,
~Roger

From: [email protected] [mailto:[email protected]] On Behalf Of Andrew 
Brampton
Sent: Saturday, February 22, 2014 8:04 AM
To: [email protected]
Subject: Creating reusable component - How to register Skin?

I am making a HexEditor component, that can efficiently scan through a large 
file. I want the component to be re-usable, but I've hit a problem with the 
Skin.

For my component to work, I have to call:
Theme.getTheme().set(HexEditor.class, HexEditorSkin.class);

I don't really want my users to have to do that.

So what's the best practice here?
Should I call that from within my HexEditor constructor? At the risk of 
overriding something the user may have set,
Or should I tell my users to register the Skin themselves?

thanks
Andrew

Reply via email to