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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:04:22+00:00 2026-06-12T23:04:22+00:00

For displaying information on a Java Swing GUI I use a mixture of JLabel

  • 0

For displaying information on a Java Swing GUI I use a mixture of JLabel components and JTextPanes.

As you can see in the following image, all labels are JLabels except for the one in the bottom right corner which is marked red and yellow. This one’s a JTextPane, cause I don’t know the text length before rendering and it has to wrap (which is not working in a JLabel, right?).

Different Rendering on Windows and Mac

The left column is aligned right and has a right-margin of 5, the right column is aligned left with zero margin.

In Eclipse WindowBuilder and on Windows 7 rendering, the JTextPane obviously has a small padding which I can’t remove.

Surprisingly, this padding isn’t shown on my Mac (Mountain Lion) and the JTextPane is aligned perfectly well.

Is there any way to achieve the same aligned look on Windows and on Mac? And why on earth does the JTextPane component has this annoying padding on windows?

  • 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-12T23:04:23+00:00Added an answer on June 12, 2026 at 11:04 pm

    Use textPane.getMargin()/setMargin()
    but actually it’s defined by L&F

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

Sidebar

Related Questions

I see many websites today displaying information in divs that a user can choose
I am displaying information as a checkbox with ThreeState enabled, and want to use
I have an AdvancedDataGrid that is displaying information in a hierarchical fashion; a list
In my Symfony 2 project, I have a page displaying information about an entity.
I am looking for displaying Forecast information in my Django Website. Do you have
I am creating a system of displaying link information in an interactive way using
I have a View controller displaying some information (not table views). I have an
I'm building a WebApp in jsf 2.0 and it's about storing information and displaying
I am fetching some information from mysql database and I am displaying it using
I have a Javascript Highchart that I'm displaying and trying to get more information

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.