File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes getting  a problem ,can't see the button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "getting  a problem ,can Watch "getting  a problem ,can New topic

getting a problem ,can't see the button

budsy remo
Ranch Hand

Joined: Sep 20, 2008
Posts: 103
hi , i was testing out card layout.

What i want in my application is three panels

At first i want the frame to be Divided into two panels and then add buttons on it . This is where the problem is coming. The button is not visible on the panel . It is visible when i remove the second panel . Another question is that can i control the size of the button on it?

here's the full code :

Any help would be appreciated.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2447
In your last question you where given a link to a section in the Swing tutorial. If you look at the table of contents you will find a section on "How to Use Card Layout" which has a working example.
Kumar Karunakaran

Joined: Mar 14, 2011
Posts: 3

Dear Friend,

The CardLayout is like a bunch of cards placed one over the other. So when you remove the one on the top you can see the one under it. To divide a panel into 3 you have to use a panel which implements GridLayout. The grid must have one row and three columns. In each you have to use seperate panels. That will work. Try it out. Anyway the CardLayout will not work.


budsy remo
Ranch Hand

Joined: Sep 20, 2008
Posts: 103
it worked , i was able to use cardlayout .
I agree. Here's the link:
subject: getting a problem ,can't see the button
It's not a secret anymore!