Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8322725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:28:55+00:00 2026-06-08T23:28:55+00:00

I would like to have a JTable component in one panel to take up

  • 0

I would like to have a JTable component in one panel to take up as much space as the window allows. Underneath, however, I would like to add another, fixed size panel with a few buttons in it. WHich layout to use to allow the bottom panel be of fixed size, while allowing JTable panel to stretch according to size of the window?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T23:28:58+00:00Added an answer on June 8, 2026 at 11:28 pm

    It’s hard to visualize what you want exactly, but here’s an excerpt from Oracle that may help you:

    Scenario: You need to display a component in as much space as it can get.

    If it is the only component in its container, use GridLayout or BorderLayout. Otherwise, BorderLayout or GridBagLayout might be a good
    match.

    If you use BorderLayout, you will need to put the space-hungry
    component in the center. With GridBagLayout, you will need to set the
    constraints for the component so that fill=GridBagConstraints.BOTH.
    Another possibility is to use BoxLayout, making the space-hungry
    component specify very large preferred and maximum sizes.

    Scenario: You need to display a few components in a compact row at their natural size.

    Consider using a JPanel to group the components and using either the JPanel’s default FlowLayout manager or the BoxLayout manager.
    SpringLayout is also good for this.

    Scenario: You need to display a few components of the same size in rows and columns.

    GridLayout is perfect for this.

    Scenario: You need to display a few components in a row or column, possibly with varying amounts of space between them, custom alignment, or custom component sizes.

    BoxLayout is perfect for this.

    Scenario: You need to display aligned columns, as in a form-like interface where a column of labels is used to describe text fields in an adjacent column.

    SpringLayout is a natural choice for this. The SpringUtilities class used by several Tutorial examples defines a makeCompactGrid
    method that lets you easily align multiple rows and columns of
    components.

    Scenario: You have a complex layout with many components.

    Consider either using a very flexible layout manager such as
    GridBagLayout or SpringLayout, or grouping the components into one or
    more JPanels to simplify layout. If you take the latter approach, each
    JPanel might use a different layout manager.

    Source: Oracle: Using Layout Managers

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two JTables that I would like displayed in one window. Currently I
I would like to have an AppWidget that designed like this one . Image:
I have a standard JTable with certain data inside. I would like to create
I have a JTable and a TableModel that extends AbstractTableModel . I would like
I have a JTable and I would like to do a filter from a
I would like to sort JTable rows based on one hidden column. Say I
I have a JTable that I would like to display a fancy tooltip (basically
I would like to have some exemple of implementation of jXSearchPanel with jTable. I
I have 3 ArrayList s and a JTable . I would like to be
So in my project i would like have a nice treeview that has images.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.