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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:05:38+00:00 2026-06-04T11:05:38+00:00

I have a JTable with the following columns: rowNumber | Element | Quantity And

  • 0

I have a JTable with the following columns:

rowNumber | Element | Quantity

And a JButton that adds rows every time it’s clicked. The column Element has a custom JComboBox cell editor that gets filled with elements from a database. However i need to do the following:

Suppose i have these elements in the JComboBox of the first row in my table:
Element1
Element2
Element3

I select Element2 from the JComboBox in the first row and then I proceed to add another row.
This new row must not show Element2 any more in its JComboBox. And the previous (first) row must not show the Element selected in the second row and so on.

  • 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-04T11:05:39+00:00Added an answer on June 4, 2026 at 11:05 am

    I think it may help to know the expected cardinality of the Set<Element>. Accordingly, @mKorbel raises the important question of scalability, citing this related discussion. In that case, the question proposes a List<DefaultCellEditor>, when a much simpler renderer will do.

    Here, a CellEditor can manage a List<DefaultComboBoxModel<Element>>, selecting the correct combo model for the row currently being edited and invoking setModel() on the editor component. As each new table row is added, the editor would add a new element to the List and adjust existing elements as required. I would expect the complexity to grow as O(n2), where n is the cardinality of the Set.

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

Sidebar

Related Questions

I have a jTable and a jButton. When clicked, the button's actionPerformed method calls
I have a JTable that is using a TableColumnModelListener() to detect when the column
Say I have following columns in my Jtable: {Item, Price} I want format the
I have a JTable with N rows and 2 columns I need to implement
I have a JTable that I want to use to display some data (a
I have a JTable with two columns and both are JComboBox, for this purpose
I have the following Problem. Let's Say I have a JTable with the folowing
i have the following jquery code to format a html table. $(.jtable td).each(function() {
I have enabled tooltips in my JTable by overriding the JComponent method that the
I have a JTable and I need to be able to reorder the columns.

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.