• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

How can I achieve this layout?

 
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure how to create this window, the upper portion is static (in that it is not alterable by this window), the lower portion is also static, but scrollable. Clicking on the button on the left (1,2) will bring up a detailed window that can be edited.

What I am unsure of is how to create a scrollable pane inside a non-scrollable pane, and to have field columns within the scrollable pane.

Thanks, Mike.



 
Sheriff
Posts: 22850
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This requires a mix of layout managers, each with its own panel.

You start with the main panel, that will have a BorderLayout.
The static top part will be added to the main panel using BorderLayout.NORTH. To go the easy way the top panel can use a right-aligned FlowLayout.
The remainder can be a JScrollPane that will be added to the main panel using BorderLayout.CENTER. Inside this JScrollPane you add a JTable - that seems to be the best option for your tabular data. That only leaves the buttons at the start of each column; do a search in this forum for how to add buttons inside tables.

Summarizing:
Check out the Javadoc pages of JScrollPane for how to use it best. Especially check out the "How to Use Scroll Panes" link.
 
Mike Lipay
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. I hadn't heard of JTable before, will have to look into the docs.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic