• Post Reply Bookmark Topic Watch Topic
  • New Topic

basic Swing questions  RSS feed

 
Paul Keohan
Ranch Hand
Posts: 411
  • Mark post as helpful
  • send pies
  • 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.
Questions:
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?
Thanks.
Paul
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!