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

  • Home
  • SEARCH
  • 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 7731759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:33:41+00:00 2026-06-01T06:33:41+00:00

On my application I got the frame containing a JSplitPane . The JSplitPane is

  • 0

On my application I got the frame containing a JSplitPane. The JSplitPane is set to split horizontally. On left side there is a panel containing some components that do not matter.
On the right I got a JPanel(BoxLayout) containing subclass of JTextArea inside a JScrollPane,a JTextPane inside a JScrollPane, and a JButton.

My problem is how I get the components(mainly on the right) to resize, based on interaction
with JSplitPane. So when the JSplitPane is dragged to the left, my
JTextArea and JTextPane get wider.

I have tried different setups, also setting the preferredSize and MaximumSize but none of this seems to work. Components stay at their preferredSize. If I try to make them smaller the scrollPane works (which is fine) but when I try to get them bigger they stay at preferred size.

  • 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-01T06:33:42+00:00Added an answer on June 1, 2026 at 6:33 am

    Most likely your problem is due to the BoxLayout used on your right panel. Copy-paste from the class javadoc:

    BoxLayout attempts to arrange components at their preferred widths (for horizontal layout) or heights (for vertical layout). For a horizontal layout, if not all the components are the same height, BoxLayout attempts to make all the components as high as the highest component. If that’s not possible for a particular component, then BoxLayout aligns that component vertically, according to the component’s Y alignment. By default, a component has a Y alignment of 0.5, which means that the vertical center of the component should have the same Y coordinate as the vertical centers of other components with 0.5 Y alignment.

    Similarly, for a vertical layout, BoxLayout attempts to make all components in the column as wide as the widest component. If that fails, it aligns them horizontally according to their X alignments. For PAGE_AXIS layout, horizontal alignment is done based on the leading edge of the component. In other words, an X alignment value of 0.0 means the left edge of a component if the container’s ComponentOrientation is left to right and it means the right edge of the component otherwise

    Use another layout which scales the inner components. For example the CENTER area of a BorderLayout has such behavior.

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

Sidebar

Related Questions

I've got an application that's using string.compare(string,string) to sort some values. The thing I
Okay still fighting with doing some SqlCacheDependecy in my Asp.net MVC application I got
I've got an application that is very graphics intensive and built on DirectX and
I've got an application that just shipped. Since I wrote it, I've learned about
I've got an application that uses DirectShow/DirectSound which plays videos and extracts the video/sound.
Ive got an application where I want to display a frame every x milliseconds.
I've got an older intranet application that needs to show two frames (a fixed
I have got a wire frame for ipad application, in which navigation bar and
I've got an application that converts OpenCV's IplImages to Tkinter images in a display
I've got a legacy application that is launched from an HTA . I'm starting

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.