pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gk_br...@verizon.net>
Subject Re: What's the best component to subclass?
Date Thu, 02 Dec 2010 01:12:00 GMT
If you want to create a completely new component, you should subclass Component and create
a corresponding skin (which will generally extend org.apache.pivot.wtk.skin.ComponentSkin,
but can simply implement org.apache.pivot.wtk.Skin if you prefer).

If your class bears any similarity to an existing component, you would almost certainly be
better off subclassing that. In this case, you'll probably also want to create a custom skin
subclass that extends the default skin for that component. However, if you do want to create
an entirely new component, you can look at the Ruler component in the ScrollPane tutorial
for an example:


See Ruler.java, RulerListener.java, and RulerSkin.java.


On Dec 1, 2010, at 8:04 PM, Bill van Melle wrote:

> In WPF, if I want to make some sort of custom control (which I do a lot, for modularity's
sake, even if the control is only used in one place), I most often subclass UserControl, which
is a boring class that has a single Content element.  What's the corresponding thing in Pivot?

View raw message