How to add jcombobox to jtable column in netbeans

enter image description here

I want to add jcombobox to jtable, please someone explain to me how I can do this in netbeans

+4
source share
1 answer

Add JComboBoxby dragging it by frame or panel. So it will be added OtherComponentsin the Navigator View

enter image description here

Add all the content you want to add by double-clicking the drop-down name from Navaigator View

Then right click on JTableand select TableContents

enter image description here

In the dialog box, select ColumnsTab (1) and select the column (2) to which you want to add combobox.

[Ref screenshot (3)]

Custom Code (4)

(5)

new DefaultCellEditor(jComboBox1)//jComboBox1 is the variable name of combobox 

enter image description here

"" , import javax.swing.DefaultCellEditor; Ctrl+Shift+I, .

2,

enter image description here

+7

All Articles