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 / December 2003

Tip: Looking for answers? Try searching our database.

Embedding a JFrame

Thread view: 
Ike - 23 Dec 2003 19:14 GMT
If I have a JFrame (with a JMenuBar, etc.) is there a way I could convert
it, somehow, such that it would run in a tab of a JTabbedPane? Could it be
(fairly easily) converted to, say, a JPanel? Or am I pretty much stuck
having to rewrite the entire thing?

Thanks, Ike
Steve W. Jackson - 23 Dec 2003 20:54 GMT
>:If I have a JFrame (with a JMenuBar, etc.) is there a way I could convert
>:it, somehow, such that it would run in a tab of a JTabbedPane? Could it be
>:(fairly easily) converted to, say, a JPanel? Or am I pretty much stuck
>:having to rewrite the entire thing?
>:
>:Thanks, Ike

Much depends on how you designed the contents.  As you no doubt know,
what you put into a JFrame goes into its content pane.  So it's that
stuff you should look into migrating onto a tabbed pane.  As for a
JToolBar, there are special methods in JFrame for holding one, but it
can be used elsewhere.  Where's this tabbed pane going to be?  In some
kind of window (JDialog, JFrame, something similar descended from
Window).  Perhaps the new parent could also help provide a home for the
menu bar in question.

= Steve =
Signature

Steve W. Jackson
Montgomery, Alabama

Jim Cobban - 26 Dec 2003 21:13 GMT
> If I have a JFrame (with a JMenuBar, etc.) is there a way I could convert
> it, somehow, such that it would run in a tab of a JTabbedPane? Could it be
> (fairly easily) converted to, say, a JPanel? Or am I pretty much stuck
> having to rewrite the entire thing?

If you need to retain the JMenuBar then you need to stick with one of the
classes which contains a JRootPane.  JFrame is not appropriate because it
implements a window in the containing windowing system, and you just want it
displayed within the existing window containing the JTabbedPane.  I haven't
tried this but you could try replacing the JFrame with a JDialog which
appears to me to be the simplest class containing a JRootPane.


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



©2009 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.