Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

getting a problem ,can't see the button

 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 3267
30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 3
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Regards

Sincerelibran
 
budsy remo
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it worked , i was able to use cardlayout .
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic