本人现在用JTable作一个属性框,现在有一个问题,就是一列中要同时加载不同内容的JCombox.并且有些行的不需要JCombox,只需要JTextField就行了!等待中............................................................................

解决方案 »

  1.   

    Using a Combo Box as an Editor 
    Setting up a combo box as an editor is simple, as the following example shows. The bold line of code sets up the combo box as the editor for a specific column. 
    TableColumn sportColumn = table.getColumnModel().getColumn(2);
    ...
    JComboBox comboBox = new JComboBox();
    comboBox.addItem("Snowboarding");
    comboBox.addItem("Rowing");
    comboBox.addItem("Chasing toddlers");
    comboBox.addItem("Speed reading");
    comboBox.addItem("Teaching high school");
    comboBox.addItem("None");
    sportColumn.setCellEditor(new DefaultCellEditor(comboBox));
      

  2.   

    高手:我要的一列中,每一行的combox的内容都不同!!