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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:03:03+00:00 2026-05-29T08:03:03+00:00

In java Swing table, how to split a cell into two, one is TextField,

  • 0

In java Swing table, how to split a cell into two, one is TextField, another one is a checkbox. I have done some codes, but doesn’t work. thanks

public class CustomTableCellRenderer extends DefaultTableCellRenderer {
        public Component getTableCellRendererComponent(JTable table, Object obj, boolean isSelected, boolean hasFocus, int row, int column) {
            Component cell = super.getTableCellRendererComponent(table, obj, isSelected, hasFocus, row, column);
            JTextField fld = new JTextField();
            JCheckBox chx = new JCheckBox();
            cell.add(fld);  // Doesn't work
            cell.add(chx);  // Doesn't work

            return cell;
        }
    }
  • 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-29T08:03:03+00:00Added an answer on May 29, 2026 at 8:03 am

    1) in this case you have to define for LayoutManager, because JLabel/JComponent (by default return TableCellRenderer) doesn’t implemented any LayoutManager

    2) put JPanel nested another JComponents (JPanel has by default FlowLayout) into Cell

    3) most confortable will be put JTextField to one Column and Boolean value (returns JCheckBox) to another Column

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

Sidebar

Related Questions

I have created one java-swing application. The application runs perfectly runs perfect on my
In Java Swing I have a simple table where in each row the name
In Java Swing I have created a JTable which uses a table model class
I've creating a Java Swing application and I realized that I have many many
I have made a java swing GUI. Now I want to display a static
I have various Java Swing applications that are used by multiple users. My deployment
I have a Java Swing application that is being used as a cluster application.
JAVA NETBEANS // resultsTable, myModel JTable resultsTable; DefaultTableModel myModel; //javax.swing.table.DefaultTableModel myModel = (DefaultTableModel) resultsTable.getModel();
In a Java Swing app (built in Netbeans 6.9), I have a JTable with
I am doing a project in java swing in which I have to use

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.