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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:07:48+00:00 2026-05-23T01:07:48+00:00

I am using NetBeans. I turned off the auto-resize of JTable columns. Now it

  • 0

I am using NetBeans. I turned off the auto-resize of JTable columns. Now it is aligned to the left side of scroll pane. How can I make it centered?

  • 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-23T01:07:48+00:00Added an answer on May 23, 2026 at 1:07 am

    Found the solution. Have to add an extra panel.

    public class GUI {
    
        public static void main(String[] args) {
            JFrame frame = new JFrame();
            frame.setSize(500, 400);
            JButton button = new JButton("Click me");
            button.setPreferredSize(new Dimension(200, 40));
            JPanel panel = new JPanel();
            panel.add(button);
            JScrollPane scrollableArea = new JScrollPane(panel);
            frame.add(scrollableArea);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
        }
    }
    

    Really a great and unexpected solution. Sometime java really acts weird. Here is the orginal post http://www.velocityreviews.com/forums/t600361-jscrollpane.html

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

Sidebar

Related Questions

I'm using NetBeans for J2ME development. Now I want to switch to develop for
I am using Netbeans 6.9 and Glassfish 3.1 to create my web application. Now,
I've been using NetBeans with xampp in windows Desktop. Now I start to learn
I'm using netBeans and I'm trying to generate a report unsing Jasper Report Can
I'm using netbeans to develop some BPEL but can't figure out how to add
im using Netbeans 7 for make a desktop application. But i can't find how
Using NetBeans IDE and Glassfish Server. For some reason I can't get a DataSource
im using netbeans with svn. i've checked out a project and then i used
im using netbeans for svn. i open a project in netbeans and then i
I created a JApplet using Netbeans 6.5.1 that accesses a database. When the program

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.