Subclassing JPanel and accessing components [message #130617] |
Fri, 01 September 2006 21:05 |
Eclipse User |
|
|
|
Originally posted by: eclipsenews.caboose.org.uk
I'm currently trying to create some subclasses of JPanel as templates
for pages of a wizard UI. For example I have a JPanel laid out
something like this (BasicPanel):
+------------------------------------------------+
|Page title |
+------------------------------------------------+
| |
| |
| Nested JPanel |
| |
| |
+------------------------------------------------+
and I want to create a subclass of that one like this (TextPanel):
+------------------------------------------------+
|Page title |
+------------+-----------------------------------+
| |Text |
| | |
| Image | |
| | |
| | |
+------------+-----------------------------------+
VE lets me create the subclass but when I try to drop some new
components into the nested JPanel it only lets me drop them into the
top-level JPanel. So I end up with the image and text replacing the title.
Is there some way that I can allow components to be dropped into the
nested JPanel of BasicPanel? I've tried exposing it as a property or a
public field but neither of those work.
I can add a method to get the nested JPanel and then add components to
it, but VE doesn't understand this and so doesn't display correctly.
Any suggestions?
Kevin
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02896 seconds