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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:47:08+00:00 2026-05-23T13:47:08+00:00

I am doing a project in Java Swing. I have a JDialog which contains

  • 0

I am doing a project in Java Swing. I have a JDialog which contains lot of text. I want the JDialog to be small and have a vertical scrollbar so that user can scroll to see the information in the JDialog. How can I get a vertical scrollbar for my JDialog?

Any suggestions would be helpful.

  • 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-23T13:47:09+00:00Added an answer on May 23, 2026 at 1:47 pm

    As you have long text use JtextArea with word wrap in it. Add that text area to JScrollPane and add scrollpane to your jdialog and its done. Now you will scroll when your text grows.

    Example:-

        JTextArea jTextArea = new JTextArea();
        jTextArea.setWrapStyleWord(true);
        jTextArea.setLineWrap(true);
    
        JScrollPane jScrollPane = new JScrollPane(jTextArea,
                JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing a project in seam that requires restful URLs. I have a view
I'm doing an AutoLisp project which uses long associative structures to do heavy geometrical
For a new project that I'm doing in PHP I've created an SQLMethods class
I have a project I am doing some maintenance work on and have got
I have a Java GUI project containing a JMenuBar and I just added a
In a small java swing 2D game, what is the best solution for creating
I am doing project on java. In one of the class, I am working
I'm doing part-of-speech & morphological analysis project for Japanese sentences. Each sentence will have
I'm doing a project in a course at my university on distributed systems. I'm
I've been doing a project at work recently focused on an almost entirely client-driven

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.