GUI Designer in 6.0 - custom components / containers
Hi all,
*
Is it possible to make a custom component / container that would render in the UI designer exactly as it would in the runtime? *
Working a bit with the GUI designer in 6.0, I've noticed something strange. Only the default toolbar components render in the designer form. Any custom components I've added only rendered as an empty gray.
Is it possible to make a custom component / container that would render in the UI designer exactly as it would in the runtime? If this is impossible, the designer would lose all the appeal it gained (for me) being able to include custom containers - If I can't layout everything just as I want to (and for that I need to see everything), I would rather build the forms / dialogs using code.
Please sign in to leave a comment.
Hello Ran,
Custom components render in the UI Designer exactly as in runtime if they
have public no-argument constructors. Otherwise there is no way for the UI
Designer to instantiate them in design time. For custom containers that are
based on standard layout managers (for example, a class derived from JPanel),
the restriction is the same.
For custom containers which do not use standard layout managers, there is
no design-time support because the UI Designer doesn't know anything about
how the components would be laid out in your container, what type of constraints
is required, etc. An example of such component is JToolBar (JToolBar itself
is supported because it's a standard Swing component, but custom components
implemented in a similar way are not.)
The UI Designer can be made pluggable to enable creating plugins for design-time
support of any custom containers, but so far we haven't seen much interest
in this.
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Thanks for the quick response. I was trying to check this by setting the background color on the constructor of a class I've extended from JPanel. Obviously, the UI designer code sets the background color at a later stage and overwrote me.
Another question thought (same topic): is it possible to use my own look and feel in the UI designer?
Hello Ran,
You can't use a different look and feel in UI Designer compared to the rest
of the IDE, but you can run the entire IDE with your look and feel.
--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"