Search code examples
javaswingjtabledefaulttablemodeltablecelleditor

How is the extra first row with a dropdown created in the JTable?


Basically i am trying to understand the "multiple JTable cell editors per column" and come across the this article on the internet

http://www.javaworld.com/article/2077465/learn-java/java-tip-102--add-multiple-jtable-cell-editors-per-column.html

Problem is in the output of the example code provided in the link, i don't understand how the first row with a dropdown created.

Thanks in Advance!!


Solution

  • i don't understand how the first row with a dropdown created.

        add(b, BorderLayout.NORTH);
        add(table, BorderLayout.CENTER);
    

    A regular combo box is added to the panel. It is not part of the table.

    The table is added as a separate component to the panel.