Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Subclassing JPanel and accessing components
Subclassing JPanel and accessing components [message #130617] Fri, 01 September 2006 21:05 Go to next message
Eclipse UserFriend
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
Re: Subclassing JPanel and accessing components [message #130647 is a reply to message #130617] Tue, 05 September 2006 14:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

The VE doesn't support subclassing twice on a container. It doesn't know
about the components that are already in the superclass.


--
Sorry,
Rich Kulp
Re: Subclassing JPanel and accessing components [message #130659 is a reply to message #130617] Wed, 06 September 2006 19:15 Go to previous message
Konstantin Scheglov is currently offline Konstantin ScheglovFriend
Messages: 555
Registered: July 2009
Senior Member
Kevin O'Rourke wrote:

> 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?

You can try Swing Designer, it is not free, but supports visual
inheritance. Check this:

http://www.instantiations.com/windowbuilderpro/demos/VisualI nheritance.html

--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)


Konstantin Scheglov,
Google, Inc.
Re: Subclassing JPanel and accessing components [message #614596 is a reply to message #130617] Tue, 05 September 2006 14:26 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

The VE doesn't support subclassing twice on a container. It doesn't know
about the components that are already in the superclass.


--
Sorry,
Rich Kulp
Re: Subclassing JPanel and accessing components [message #614597 is a reply to message #130617] Wed, 06 September 2006 19:15 Go to previous message
Konstantin Scheglov is currently offline Konstantin ScheglovFriend
Messages: 555
Registered: July 2009
Senior Member
Kevin O'Rourke wrote:

> 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?

You can try Swing Designer, it is not free, but supports visual
inheritance. Check this:

http://www.instantiations.com/windowbuilderpro/demos/VisualI nheritance.html

--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)


Konstantin Scheglov,
Google, Inc.
Previous Topic:VE Models interaction
Next Topic:can I build the source to .exe file
Goto Forum:
  


Current Time: Wed May 08 00:59:15 GMT 2024

Powered by FUDForum. Page generated in 0.02896 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top