• Post Reply Bookmark Topic Watch Topic
  • New Topic

BorderLayout and JScrollPane problems

 
Ekhard Aldric
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a `JFrame` with three areas:

- A scrollpane with a list of objects at borderlayout.west
- A panel with labels and textfields at borderlayout.east
- A scrollpane with a panel potentially having multiple labels at borderlayout.south

When you click an item on the list of objects, the textfields on the east panel should be filled and the labels on the south scroll should be created. I have two problems with my code though:

1. For some reason the scrollpane at the botom of the screen does not fill the whole borderlayout's south area, only half of it.
2. the south scrollpane does not show anything when an item on the list is selected.

Here I tried to make an easily testable example:
 
Campbell Ritchie
Marshal
Posts: 52549
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Setting up layouts should be something for the constructor of the display (or a setUpGUI method). You should not set up layouts or add components or anything in an action method. Also try not setting any sizes, but leaving the layout to work out the sizes for itself.
 
Rob Camick
Ranch Hand
Posts: 2699
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quit cross posting: http://stackoverflow.com/questions/34977941/borderlayout-and-jscrollpane-problems/34980698You were given suggestions in your last question. You have not implemented any of the suggestions.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!