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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:38:03+00:00 2026-05-31T17:38:03+00:00

I am using html to make text in a JLabel span multiple lines. However

  • 0

I am using html to make text in a JLabel span multiple lines. However if I enter a long string with no spaces it doesn’t go onto a new line and instead causes an underlying JScrollpane to display a horizontal scrollbar and pushs the components to the right of the JLabel out of the view area. So anyone know if it is possible to word wrap strings without spaces in a JLabel?

  • 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-05-31T17:38:04+00:00Added an answer on May 31, 2026 at 5:38 pm

    You can use a JTextAreafor that purpose:

    JTextArea ta = new JTextArea();
    ta.setEditable(false);
    ta.setLineWrap(true);
    ta.setOpaque(false);
    ta.setWrapStyleWord(false); // This makes wrapping on char boundaries, and I think is the default value
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make some text bold using HTML, but I'm struggling to get
I'm trying to make a login page using html, ajax & ASP.NET.The data is
I'm trying to make a simple Python-based HTML parser using regular expressions. My problem
I am traversing a HTML document using javascript DOM. I want make a list
I've been trying to make a simple search inside a static HTML page using
Using HTML and CSS. I have text surrounded by a border using display:inline to
When using HTML custom attributes it doesn't works in Chrome. What I mean is,
I'm using this method to parse out plain text URLs in some HTML and
I am trying to replace some div text automatically using the .html command in
I have been using this: http://blog.leahculver.com/2010/12/iphone-pull-to-refresh.html to make the pull to refresh function in

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.