tags:

views:

38

answers:

1

I have this code but it doesn't work:

jPanel1.add(jLabel1);
jPanel2.add(jButton1);
jPanel2.add(jButton2);
jPanel3.add(jPanel1,jPanel1.TOP_ALIGNMENT);
jPanel3.add(jPanel2,jPanel2.BOTTOM_ALIGNMENT);
setContentPane(jPanel3);

pack();

Please tell me why!

+2  A: 

You're not setting a LayoutManager on any of the panels. This tutorial may be of use to you

Richie_W
Thank's a lot! It realy helped me!
John
@John: Please consider accepting and/or up-voting this answer.
trashgod