• 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

basic Swing questions

Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've gone through several of the Sun tutorials but they're not helping. I am creating a frame with a list on one side and sixteen buttons on the other side. I have put the list on a panel and the buttons on a panel. I've put these two panels on the content pane. All well and good so far.
If I change the size of the overall frame, why does the panel with the buttons resize appropriately but the list panel does not change size?
Depending on the list selection, the buttons' text will change. Why do all sixteen buttons resize to the button that has the longest text on it? Frequently, half the button panel is hidden by the list panel or it squishes up and looks too small.
I've been looking through the APIs but there's so much potential fixes, it's overwhelming. Could someone suggest a beginners book which will answer a lot of basic appearance questions?
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know about a book. But what helped me was just playing with the various layouts and components. Components act differently in different layouts. You need to get a good understanding of what happens with each.
For instance, on your button question. Try making a panel with vertical BoxLayout. They won't all be the same size. Or use FlowLayout. What happens to the component when in the various locations in BorderLayout.
Create a simple test client and play with the various layouts.
Would you like to try a free sample? Today we are featuring tiny ads:
a bit of art, as a gift, that will fit in a stocking
    Bookmark Topic Watch Topic
  • New Topic