Article View: borland.public.jbuilder.java.swing
Article #8463URGENT: Break Out Panel Into NEW Frame???
From: Nikolaos Giannopoulos
Date: Thu, 24 Aug 2000 00:00
Date: Thu, 24 Aug 2000 00:00
29 lines
1763 bytes
1763 bytes
Anyone know why the following code won't work:
JFrame newFrame = new
JFrame(jTabbedPane1.getTitleAt(jTabbedPane1.getSelectedIndex()));
FileEditorPane lineEditor = (FileEditorPane)
jTabbedPane1.getSelectedComponent();
jTabbedPane1.removeTabAt(jTabbedPane1.getSelectedIndex());
newFrame.getContentPane().setLayout(new GridLayout());
newFrame.getContentPane().add(lineEditor);
Solmar.Utils.FrameTools.formatFrame(newFrame, true, 600, 500, true);
Whereas the following will:
FileEditorPane lineEditor = new FileEditorPane();
newFrame.getContentPane().setLayout(new GridLayout());
newFrame.getContentPane().add(lineEditor);
Solmar.Utils.FrameTools.formatFrame(newFrame, true, 600, 500, true);
Basically I am taking a JPanel (which is what the FileEditorPane is at
its root) and trying to remove it from a JTabbedPane and then trying to
show it (the FileEditorPane) in a JFrame. Basically I get a blank
JFrame.
It seems that once a component is added to a JTabbedPane that I can't
get it out without hosing the component OR that the component is not
displaying itself in the JFrame - I've tried using setVisible(true) on
the component to no avail.
--Nikolaos
Technical Details
Message-ID:
<39A536B5.D019D689@solmar.ca>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,9d3839a0657a8572,start X-Google-Attributes: gid111d45,public From: Nikolaos Giannopoulos <nikolaos@solmar.ca> Subject: URGENT: Break Out Panel Into NEW Frame??? Date: 2000/08/24 Message-ID: <39A536B5.D019D689@solmar.ca> X-Deja-AN: 661972937 Content-Transfer-Encoding: 7bit Organization: Another Netscape Collabra Server User X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing