Added JTable to JFrame... now can't add other components [message #113261] |
Thu, 15 December 2005 03:40 |
Eclipse User |
|
|
|
Originally posted by: stjohnsoftware.yahoo.com
Using the Visual Editor, I added a JTable to a JFrame. I added it to the
"Center". However, after doing this, I cannot add any other components to
the JFrame.
Is this due to something I'm doing wrong or a misunderstanding on my part of
how JTables & JFrames work?
|
|
|
Re: Added JTable to JFrame... now can't add other components [message #113304 is a reply to message #113261] |
Thu, 15 December 2005 04:06 |
Eclipse User |
|
|
|
Originally posted by: stjohnsoftware.yahoo.com
I found the problem.
It looks like the generated code was setting the content pane
(JFrame::setContentPane()) to the JScrollPane instance rather than adding it
(JFrame::add())
Sorry, obviously a newbie here -- to both Swing & VE
"sjs" <stjohnsoftware@yahoo.com> wrote in message
news:dnqoo5$7br$1@news.eclipse.org...
> Using the Visual Editor, I added a JTable to a JFrame. I added it to the
> "Center". However, after doing this, I cannot add any other components to
> the JFrame.
>
> Is this due to something I'm doing wrong or a misunderstanding on my part
> of how JTables & JFrames work?
>
|
|
|
Re: Added JTable to JFrame... now can't add other components [message #113328 is a reply to message #113304] |
Thu, 15 December 2005 14:34 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You do not add to the JFrame itself. That is invalid. You must add only
to the content pane. If it doesn't already have a content pane you
should use the context menu on the JFrame and select the create content
pane menu item. then you can drop on the content pane.
> I found the problem.
>
> It looks like the generated code was setting the content pane
> (JFrame::setContentPane()) to the JScrollPane instance rather than adding it
> (JFrame::add())
>
> Sorry, obviously a newbie here -- to both Swing & VE
>
--
Thanks,
Rich Kulp
|
|
|
Re: Added JTable to JFrame... now can't add other components [message #611612 is a reply to message #113261] |
Thu, 15 December 2005 04:06 |
Eclipse User |
|
|
|
Originally posted by: stjohnsoftware.yahoo.com
I found the problem.
It looks like the generated code was setting the content pane
(JFrame::setContentPane()) to the JScrollPane instance rather than adding it
(JFrame::add())
Sorry, obviously a newbie here -- to both Swing & VE
"sjs" <stjohnsoftware@yahoo.com> wrote in message
news:dnqoo5$7br$1@news.eclipse.org...
> Using the Visual Editor, I added a JTable to a JFrame. I added it to the
> "Center". However, after doing this, I cannot add any other components to
> the JFrame.
>
> Is this due to something I'm doing wrong or a misunderstanding on my part
> of how JTables & JFrames work?
>
|
|
|
Re: Added JTable to JFrame... now can't add other components [message #611617 is a reply to message #113304] |
Thu, 15 December 2005 14:34 |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You do not add to the JFrame itself. That is invalid. You must add only
to the content pane. If it doesn't already have a content pane you
should use the context menu on the JFrame and select the create content
pane menu item. then you can drop on the content pane.
> I found the problem.
>
> It looks like the generated code was setting the content pane
> (JFrame::setContentPane()) to the JScrollPane instance rather than adding it
> (JFrame::add())
>
> Sorry, obviously a newbie here -- to both Swing & VE
>
--
Thanks,
Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.04169 seconds