Board index » jbuilder » custom components

custom components

2003-08-27 01:27:18 AM
jBuilder 2.0 Applet using AWT only (no Swing etc).
Trying to make custom components. They work fine in applet's main panel,
cannot get them to work in a sub-panel on the main panel.
MyComponent (extends Component) will not display in MyPanel (extends Panel).
MyComponent DOES display in applet main panel.
Buttons work on main panel or on MyPanel and can be added by main class
or MyPanel's constructor can add buttons to itself. What's a button got
MyComponent does not?
Applet can add(MyComponent), but CANNOT MyPanel.add(MyComponent),
and MyPanel's constructor CANNT add(MyComponent).
MyComponent is trivial, just paints a text string.
MyPanel is trival also, just has background color so I can see it all.
Thank you.

Re:custom components

I am inheriting my own set of components from the bold components.
The purpose is to be able to make widespread changes to the look and
feel (i.e. color, border, etc.) to the components in the program.
I would like to be able to make my version of TBoldEdit display
differently if the bold attribute is derived. I was wondering if
anyone had done this as I have run into brick walls. The methods I
want to override are private.
Any suggestions are welcome.

Re:custom components

I would suggest inheriting fom TEdit instead, and adding the BoldProperties
requirements. There is an article how to do this somewhere, and the
controls probably already come with source.