當前位置: 首頁>>代碼示例>>Java>>正文


Java DefaultTableModel.removeRow方法代碼示例

本文整理匯總了Java中javax.swing.table.DefaultTableModel.removeRow方法的典型用法代碼示例。如果您正苦於以下問題:Java DefaultTableModel.removeRow方法的具體用法?Java DefaultTableModel.removeRow怎麽用?Java DefaultTableModel.removeRow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.table.DefaultTableModel的用法示例。


在下文中一共展示了DefaultTableModel.removeRow方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setHandsAndBallsTableSize

import javax.swing.table.DefaultTableModel; //導入方法依賴的package包/類
final private void setHandsAndBallsTableSize() {

		final int intLballsPreviousNumber = this.intGballsNumber;

		this.intGballsNumber =
								Math.max(	0,
											this.objGjuggleMasterPro.objGsiteswap == null
												|| this.objGjuggleMasterPro.objGsiteswap.bytGstatus <= Constants.bytS_STATE_SITESWAP_UNKNOWN_BALLS_NUMBER
																																							? 0
																																							: this.objGjuggleMasterPro.objGsiteswap.intGballsNumber);
		if (this.intGballsNumber != intLballsPreviousNumber) {
			final DefaultTableModel objLdefaultTableModel = (DefaultTableModel) this.objGhandsAndBallsJTable.getModel();
			if (this.intGballsNumber > intLballsPreviousNumber) {
				for (int intLballIndex = intLballsPreviousNumber; intLballIndex < this.intGballsNumber; ++intLballIndex) {
					objLdefaultTableModel.addRow(new String[DataJFrame.bytS_HANDS_AND_BALLS_TABLE_COLUMNS_NUMBER]);
				}
			} else {
				for (int intLballIndex = intLballsPreviousNumber; intLballIndex > this.intGballsNumber; --intLballIndex) {
					objLdefaultTableModel.removeRow(intLballIndex + 1);
				}
			}
		}
	}
 
開發者ID:jugglemaster,項目名稱:JuggleMasterPro,代碼行數:24,代碼來源:DataJFrame.java

示例2: Show_Users_In_JTable

import javax.swing.table.DefaultTableModel; //導入方法依賴的package包/類
private void Show_Users_In_JTable() {
    DefaultTableModel modele = (DefaultTableModel)jTable1.getModel();
    Object[] row = new Object[3]; for (int i = 0; i < jTable1.getRowCount(); i++) { modele.removeRow(i); }
    String active = "" ;
   for(int i = 0; i < Plugins.size(); i++)
   {
        try {
            String text = new String(Files.readAllBytes(Paths.get(pluginMapPath.get(i))), StandardCharsets.UTF_8);
            if (text.contains(" deactivated")) { active = "NO"; } else { active = "YES"; }
            row[0] = Plugins.get(i).getName();
            row[1] = Plugins.get(i).category();
            row[2] = active ;
            
            modele.addRow(row);
        } catch (IOException ex) {
            Logger.getLogger(PluginManager.class.getName()).log(Level.SEVERE, null, ex);
        }
   }
}
 
開發者ID:Thecarisma,項目名稱:powertext,代碼行數:20,代碼來源:PluginManager.java

示例3: changeRow

import javax.swing.table.DefaultTableModel; //導入方法依賴的package包/類
private void changeRow(Object fo, String key) {
    Integer row = key2RowNumber.get(key);
    DefaultTableModel model = (DefaultTableModel) times.getModel();
    
    if (row != null) {
        model.removeRow(row);
    }
    
    TimesCollectorPeer.Description desc = TimesCollectorPeer.getDefault().getDescription(fo, key);
    
    if (desc == null) {
        return ;
    }
    
    if (row == null) {
        key2RowNumber.put(key, row = model.getRowCount());
    }
    
    model.insertRow(row, new Object[] {desc.getMessage(), desc.getTime()});
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:21,代碼來源:TimeComponentPanel.java

示例4: deleteMouseClicked

import javax.swing.table.DefaultTableModel; //導入方法依賴的package包/類
private void deleteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_deleteMouseClicked
    // TODO add your handling code here:刪除快照
    int op = JOptionPane.showConfirmDialog(rootPane, "確定要刪除嗎", "提示", JOptionPane.YES_NO_OPTION);
    //點是返回0,否返回1,有悖常理啊    
    String snapshotID = null;
    snapshotID = snapshotList.getValueAt(snapshotList.getSelectedRow(), 0).toString();
    if (op == 0) {
        rebuild.doSnapshot(cAuth, cRegion, snapshotID, "DeleteSnapshot", null);
        JOptionPane.showMessageDialog(null, "刪除快照指令已發出", "提示", JOptionPane.INFORMATION_MESSAGE);
        DefaultTableModel tableModel = (DefaultTableModel) snapshotList.getModel();
        tableModel.removeRow(snapshotList.getSelectedRow());
    }    
    else
        System.out.println("操作已取消");
    
    
    
    
}
 
開發者ID:BennyThink,項目名稱:qcloudClient,代碼行數:20,代碼來源:Console.java

示例5: supprimerActionPerformed

import javax.swing.table.DefaultTableModel; //導入方法依賴的package包/類
private void supprimerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_supprimerActionPerformed

        if (!list.isEmpty()) {
            DefaultTableModel model1 = (DefaultTableModel) jTable1.getModel();
            model1.removeRow(count - 1);
            list.remove(list.size() - 1);
            System.out.println(list.size() - 1);
            System.out.println(count);
            count--;
        } else {
            JOptionPane.showMessageDialog(this, "Tableau vide");
        }
    }
 
開發者ID:MF1996,項目名稱:Scheduler-Marwa-slafa-FEHIM-Mahfoud-,代碼行數:14,代碼來源:MaskSaisie.java

示例6: moveUpVarButtonActionPerformed

import javax.swing.table.DefaultTableModel; //導入方法依賴的package包/類
private void moveUpVarButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_moveUpVarButtonActionPerformed
    int index = childrenVariablesTable.getSelectedRow();
    if (index <= 0) return ;
    DefaultTableModel model = (DefaultTableModel) childrenVariablesTable.getModel();
    Object[] row = new Object[] { model.getValueAt(index, 0), model.getValueAt(index, 1) };
    model.removeRow(index);
    model.insertRow(index - 1, row);
    childrenVariablesTable.getSelectionModel().setSelectionInterval(index - 1, index - 1);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:VariableFormatterEditPanel.java

示例7: moveDownVarButtonActionPerformed

import javax.swing.table.DefaultTableModel; //導入方法依賴的package包/類
private void moveDownVarButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_moveDownVarButtonActionPerformed
    int index = childrenVariablesTable.getSelectedRow();
    if (index < 0) return ;
    DefaultTableModel model = (DefaultTableModel) childrenVariablesTable.getModel();
    if (index >= (model.getRowCount() - 1)) return ;
    Object[] row = new Object[] { model.getValueAt(index, 0), model.getValueAt(index, 1) };
    model.removeRow(index);
    model.insertRow(index + 1, row);
    childrenVariablesTable.getSelectionModel().setSelectionInterval(index + 1, index + 1);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:VariableFormatterEditPanel.java

示例8: fillTimeTable

import javax.swing.table.DefaultTableModel; //導入方法依賴的package包/類
private void fillTimeTable() {
    Reference ref = (Reference)jList1.getSelectedValue();
    Object fo = ref == null ? null : ref.get();
    
    // clear the table
    DefaultTableModel model = (DefaultTableModel) times.getModel();
    while (model.getRowCount() > 0) {
        model.removeRow(0);
    }
    key2RowNumber.clear();
    
    if (fo == null) return;
    
    Collection<String> keys = TimesCollectorPeer.getDefault().getKeysForFile(fo);
    for (int i = 0; i < 10; i++) {
        try {
            synchronized(keys) {
                for (String key : keys) {
                    changeRow(fo, key);
                }
                return;
            }
        } catch (ConcurrentModificationException ex) {
            LOG.log(Level.INFO, "Retry " + i, ex);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:28,代碼來源:TimeComponentPanel.java

示例9: clearEmptyRow

import javax.swing.table.DefaultTableModel; //導入方法依賴的package包/類
private synchronized void clearEmptyRow() {
	DefaultTableModel dftm = (DefaultTableModel) table.getModel();
	for (int i = 0; i < table.getRowCount(); i++) {
		TbSpinfo info2 = (TbSpinfo) table.getValueAt(i, 0);
		if (info2 == null || info2.getId() == null
				|| info2.getId().isEmpty()) {
			dftm.removeRow(i);
		}
	}
}
 
開發者ID:Edward7Zhang,項目名稱:SuperMarketManageSystem,代碼行數:11,代碼來源:XiaoShouDan.java

示例10: removeOptionButtonActionPerformed

import javax.swing.table.DefaultTableModel; //導入方法依賴的package包/類
private void removeOptionButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeOptionButtonActionPerformed
    DefaultTableModel model = (DefaultTableModel) processorOptionsTable.getModel();
    int[] rows = processorOptionsTable.getSelectedRows();
    for(int i = rows.length - 1 ; i >= 0 ; i--) {
        model.removeRow(rows[i]);
    }
    if (model.getRowCount() > 0) {
        // Select reasonable row
        int selectedIndex = rows[rows.length - 1] - rows.length  + 1;
        if ( selectedIndex > model.getRowCount() - 1) {
            selectedIndex = model.getRowCount() - 1;
        }
        processorOptionsTable.setRowSelectionInterval(selectedIndex, selectedIndex);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:16,代碼來源:CustomizerCompile.java

示例11: removeCapActionPerformed

import javax.swing.table.DefaultTableModel; //導入方法依賴的package包/類
private void removeCapActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeCapActionPerformed
    int[] rows = capTable.getSelectedRows();
    if (rows != null) {
        DefaultTableModel model = (DefaultTableModel) capTable.getModel();
        for (int i = rows.length - 1; i >= 0; i--) {
            model.removeRow(rows[i]);
        }
    }
}
 
開發者ID:CognizantQAHub,項目名稱:Cognizant-Intelligent-Test-Scripter,代碼行數:10,代碼來源:DriverSettings.java

示例12: removeActionPerformed

import javax.swing.table.DefaultTableModel; //導入方法依賴的package包/類
private void removeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeActionPerformed
    int[] rows = moduleTable.getSelectedRows();
    if (rows != null) {
        DefaultTableModel model = (DefaultTableModel) moduleTable.getModel();
        for (int i = rows.length - 1; i >= 0; i--) {
            model.removeRow(rows[i]);
        }
    }
}
 
開發者ID:CognizantQAHub,項目名稱:Cognizant-Intelligent-Test-Scripter,代碼行數:10,代碼來源:TMSettings.java

示例13: limpiarTabla

import javax.swing.table.DefaultTableModel; //導入方法依賴的package包/類
public void limpiarTabla(DefaultTableModel modelo) //recibe el modelo de la tabla
{
    int filas = modelo.getRowCount(); //para saber cuantas filas tiene la tabla hasta el momento
    for(int i=0;i<filas;i++)//colocamos "<" porque  sino borrara una fila inexistente
    {
        modelo.removeRow(0); //para que valla borrando borrando la PRIMERA linea(que en si es toda la tabla)
    }
}
 
開發者ID:JuanJoseFJ,項目名稱:ProyectoPacientes,代碼行數:9,代碼來源:Cita.java

示例14: updateTable

import javax.swing.table.DefaultTableModel; //導入方法依賴的package包/類
private void updateTable(List list, final DefaultTableModel dftm) {
	int num = dftm.getRowCount();
	for (int i = 0; i < num; i++)
		dftm.removeRow(0);
	Iterator iterator = list.iterator();
	TbKhinfo khInfo;
	while (iterator.hasNext()) {
		List info = (List) iterator.next();
		Item item = new Item();
		item.setId((String) info.get(0));
		item.setName((String) info.get(1));
		khInfo = Dao.getKhInfo(item);
		Vector rowData = new Vector();
		rowData.add(khInfo.getId().trim());
		rowData.add(khInfo.getKhname().trim());
		rowData.add(khInfo.getAddress().trim());
		rowData.add(khInfo.getJian().trim());
		rowData.add(khInfo.getBianma().trim());
		rowData.add(khInfo.getTel().trim());
		rowData.add(khInfo.getFax().trim());
		rowData.add(khInfo.getLian().trim());
		rowData.add(khInfo.getLtel().trim());
		rowData.add(khInfo.getMail().trim());
		rowData.add(khInfo.getXinhang().trim());
		rowData.add(khInfo.getHao().trim());
		dftm.addRow(rowData);
	}
}
 
開發者ID:Edward7Zhang,項目名稱:SuperMarketManageSystem,代碼行數:29,代碼來源:KeHuChaXun.java

示例15: updateTable

import javax.swing.table.DefaultTableModel; //導入方法依賴的package包/類
private void updateTable(List list, final DefaultTableModel dftm) {
	int num = dftm.getRowCount();
	for (int i = 0; i < num; i++)
		dftm.removeRow(0);
	Iterator iterator = list.iterator();
	TbSpinfo spInfo;
	while (iterator.hasNext()) {
		List info = (List) iterator.next();
		Item item = new Item();
		item.setId((String) info.get(0));
		item.setName((String) info.get(1));
		spInfo = Dao.getSpInfo(item);
		Vector rowData = new Vector();
		rowData.add(spInfo.getId().trim());
		rowData.add(spInfo.getSpname().trim());
		rowData.add(spInfo.getJc());
		rowData.add(spInfo.getCd());
		rowData.add(spInfo.getDw());
		rowData.add(spInfo.getGg());
		rowData.add(spInfo.getBz());
		rowData.add(spInfo.getPh());
		rowData.add(spInfo.getPzwh());
		rowData.add(spInfo.getGysname());
		rowData.add(spInfo.getMemo());
		dftm.addRow(rowData);
	}
}
 
開發者ID:Edward7Zhang,項目名稱:SuperMarketManageSystem,代碼行數:28,代碼來源:ShangPinChaXun.java


注:本文中的javax.swing.table.DefaultTableModel.removeRow方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。