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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:59:36+00:00 2026-06-10T03:59:36+00:00

I’d like to create a JTable with a UI similar to this: where the

  • 0

I’d like to create a JTable with a UI similar to this:

enter image description here

where the “+” and “-” indicate buttons that add or remove the associated row or column. To ensure that the buttons align well with the existing rows and columns, it seems easiest to extend the table beyond the data portion to also include the buttons. So, the table above would have 5 rows and 6 columns.

Questions:

  1. Can I place buttons above the column headers in a JTable?
  2. My understanding is that I can’t remove the cell borders for the buttons and blank cells (see here) at the cell level. Then, are there alternative ways to make the buttons align with the columns or rows?
  3. Are there similar UI styles you’ve seen or used that permit the desired behavior? Any libraries? I know this can be accomplished with, e.g., a combo box for choosing a particular row or column to be deleted. However, I’d prefer styles where the option to add/remove a row/column is placed immediately next to the row/column.

Thanks for your help.

  • 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-10T03:59:38+00:00Added an answer on June 10, 2026 at 3:59 am

    The short answer is (mostly) yes, the long answer, it’s a bit of work.

    I would take advantage of the JScrollPane‘s row header, see setRowHeader for more details.

    enter image description here

    (Picture used from the JavaDocs)

    This will require you to layout your components to match the height of each row.

    The table header is a little more complicated and comes down to whether this is a custom table implementation or not.

    If you intent to extend JTable (or a sub component of), you should take a look into replacing the functionality of the configureEnclosingScrollPane (and corresponding unconfigureEnclosingScrollPane) method. This would allow you to wrap the JTableHeader in a custom component and set it to the scroll pane’s column header position.

    If not, you will need to adjust the scroll pane’s column header yourself. Either way, the basic approach is the same.

    You want a component, that can use the JTableHeader and provide you the means to layout out the components you want. I’d use something like a BorderLayout with the JTableHeader in the South position and your controls in the North

    IMHO

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I know there's a lot of other questions out there that deal with this
I'm trying to create an if statement in PHP that prevents a single post
I would like to count the length of a string with PHP. The string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has

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.