JPanel in a JFrame???
  Home FAQ Contact Sign in
comp.lang.java.gui only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.java.gui Profile…
 Up
JPanel in a JFrame???         


Author: Luka
Date: Jul 4, 2008 02:22

Hello Group,
i need a little help here:

i have a JFrame with two buttons which are in JPanel1, what i want is
to put another JPanel2 in a JFrame on buttonAction, under the first
panel (JPanel1).

That second panel (JPanel2) have some buttons and textFields in it...

i try with :

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
{

this.getContentPane().add(jPanel2);
pack();
setVisible(true);

}

i also try to put jPanel2 in some empty jPanel3 which is under jPanel1
on the JFrame with:

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
{
Show full article (0.77Kb)
2 Comments
Re: JPanel in a JFrame???         


Author: RedGrittyBrick
Date: Jul 4, 2008 07:07

Luka wrote:
> Hello Group,
> i need a little help here:
>
> i have a JFrame with two buttons which are in JPanel1, what i want is
> to put another JPanel2 in a JFrame on buttonAction, under the first
> panel (JPanel1).
>
> That second panel (JPanel2) have some buttons and textFields in it...
>
> i try with :
>
> private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
> {
>
> this.getContentPane().add(jPanel2);
> pack();
> setVisible(true);
>
> } ...
Show full article (1.28Kb)
no comments
Re: JPanel in a JFrame???         


Author: caultonpos
Date: Jul 6, 2008 22:47

On Jul 4, 5:22 am, Luka gmail.com> wrote:
> Hello Group,
> i need a little help here:
>
> i have a JFrame with two buttons which are in JPanel1, what i want is
> to put another JPanel2 in a JFrame on buttonAction, under the first
> panel (JPanel1).
>
> That second panel (JPanel2) have some buttons and textFields in it...
>
> i try with :
>
> private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
> {
>
>        this.getContentPane().add(jPanel2);
>        pack();
>        setVisible(true);
>
> } ...
Show full article (1.13Kb)
no comments