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 8764915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:09:09+00:00 2026-06-13T16:09:09+00:00

In my application, there are 4 panels. And i need to insert them into

  • 0

In my application, there are 4 panels. And i need to insert them into the main panel, which uses BorderLayout. The 4 panels are…

  1. A thin Image strip.
  2. 4 buttons just below above
  3. A TextField covering the complete page.
  4. An about at end.

This is my code…

    add(imageLabel, BorderLayout.NORTH);
    add(buttonPanel,BorderLayout.PAGE_START);
    add(logScrollPane, BorderLayout.CENTER);
    add(about, BorderLayout.PAGE_END);

When I do this, the buttonPanel disappears. How can I achieve what I need?

  • 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-13T16:09:10+00:00Added an answer on June 13, 2026 at 4:09 pm

    I usually try to keep a maximum of 3 components in any BorderLayout, so I would do it like this…

    JPanel outerPanel = new JPanel(new BorderLayout());
    JPanel innerPanel= new JPanel(new BorderLayout());
    
    innerPanel.add(buttonPanel,BorderLayout.NORTH);
    innerPanel.add(logScrollPane, BorderLayout.CENTER);
    innerPanel.add(about, BorderLayout.SOUTH);
    
    outerPanel.add(imageLabel, BorderLayout.NORTH);
    outerPanel.add(innerPanel,BorderLayout.CENTER);
    

    As long as you keep the ‘maximum-stretched’ component in the CENTER (in this case, your logScrollPane) then it’ll always work. If you want to use the panel, such as setting it on a JFrame, just use add(outerPanel).

    Don’t be afraid of BorderLayout – the ability of this layout to auto-expand the CENTER component to fill the available space make it a very powerful and very important LayoutManager!

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

Sidebar

Related Questions

Is there a way to host wcf service application with Plesk Panel 9.2 in
I create some elements( UIComponents, mainly Panels) inside the mx:Application name=tst . I need
There is a need to dynamically change a view in ExtJS 4 grid panel
I'm working on a PyQt application. Currently, there's a status panel (defined as a
Some where in the application there is an autogenerated query like SELECT DISTINCT `Name`,`Number`
In my Java application there is a Socket open and data is being read
In my application there is a ListFragment where each item from the list contains
In System.Windows.Forms.Application there are two properties called LocalUserAppDataPath and UserAppDataPath . On this computer
In the application there is a string in the following format: String elements =
In my application - there are four buttons named as follows: Top - left

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.