Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / April 2004

Tip: Looking for answers? Try searching our database.

JlayeredPane inside a JPanel??

Thread view: 
Gaz - 14 Apr 2004 00:06 GMT
Is it possible to have a JLayeredPane inside a JPanel??

I've tried this but the JLayeredPane does not display:

JFrame myFrame = new JFrame();
JPanel myPanel = new JPanel();
JLayeredPane layeredPane = new JLayeredPane();

//Add stuff to JLayeredPane

myPanel.add(layeredPane);
frame.getContentPane().add(myPanel);
frame.show();

(I know that the frame settings are fine and as a test I've added a JLabel
to the JPanel and that displays ok)
ak - 14 Apr 2004 12:04 GMT
> Is it possible to have a JLayeredPane inside a JPanel??
>
> I've tried this but the JLayeredPane does not display:
>
> JFrame myFrame = new JFrame();
> JPanel myPanel = new JPanel();

myPanel.setLayout(new BorderLayout());

> JLayeredPane layeredPane = new JLayeredPane();
>
[quoted text clipped - 3 lines]
> frame.getContentPane().add(myPanel);
> frame.show();

____________

http://reader.imagero.com the best java image reader.
Steve W. Jackson - 14 Apr 2004 16:43 GMT
>:> Is it possible to have a JLayeredPane inside a JPanel??
>:>
[quoted text clipped - 12 lines]
>:> frame.getContentPane().add(myPanel);
>:> frame.show();

I fail to see what that would do.  The default layout manager for JPanel
is FlowLayout anyway.

However, it seems like the OP could benefit from visiting the tutorial
on using a layered pane.  It can be found at
<http://java.sun.com/docs/books/tutorial/uiswing/components/layeredpane.h
tml>.  It includes a discussion of how to use the layered pane as a
component for managing Z order of other components, and also mentions
that Java 1.5 is expected to have an API for managing Z order without
the use of a JLayeredPane.

= Steve =
Signature

Steve W. Jackson
Montgomery, Alabama



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.