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

BorderLayout and JScrollPane problems

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic