第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Java SWT 表格單元格比較

Java SWT 表格單元格比較

紅糖糍粑 2021-08-25 17:12:49
我正在使用 SWT 開發(fā) GUI。該軟件獲取txt文件并將所有數(shù)據(jù)推送到表格中。是否可以連續(xù)遍歷每個(gè)單元格來比較單元格?并遍歷表中的每一行來完成。我無法理解如果我只有 .getColumnCount()另一件事:是否可以突出顯示不同的單元格?編輯:                        for (int loopIndexPM1ColumnTools = 0; loopIndexPM1ColumnTools < tableConfigurationSystemColumnLP.size(); loopIndexPM1ColumnTools++) {                        TableColumn column = new TableColumn(tableConfigurationLP, SWT.NONE, loopIndexPM1ColumnTools);                        column.setWidth(100);                        column.setText(tableConfigurationSystemColumnLP.get(loopIndexPM1ColumnTools));                      }                    /*                     * Loop for adding items to each column in CE-LP Tab                     */                      for (int loopIndexPM1ColumnTools = 0; loopIndexPM1ColumnTools < CE_LP_Parameter.size(); loopIndexPM1ColumnTools++) {                        TableItem item = new TableItem(tableConfigurationLP, SWT.NONE);                        item.setText(0, CE_LP_Parameter.get(loopIndexPM1ColumnTools));                        item.setText(1, CE_LP1_Value.get(loopIndexPM1ColumnTools));                        item.setText(2, CE_LP2_Value.get(loopIndexPM1ColumnTools));                        item.setText(3, CE_LP3_Value.get(loopIndexPM1ColumnTools));                      }                      for (int loopIndexPM1ColumnTools = 0; loopIndexPM1ColumnTools < tableConfigurationSystemColumnLP.size(); loopIndexPM1ColumnTools++) {                          tableConfigurationLP.getColumn(loopIndexPM1ColumnTools).pack();                      }編輯:                          int tbl_clm = tableConfigurationLP.getColumnCount();                      int tbl_rows = tableConfigurationLP.getItemCount();                      for(int i=0;i<tbl_clm;i++) {                          for(int x=0;x<tbl_rows;x++) {                              System.out.println(tableConfigurationLP.getColumn(i).getText());                          }                      }
查看完整描述

1 回答

?
HUX布斯

TA貢獻(xiàn)1876條經(jīng)驗(yàn) 獲得超6個(gè)贊

Table 已

  • getItemCount() 給你行數(shù)

  • getItem(rowIndex)得到TableItem在行rowIndex

  • getItems()得到所有TableItem

  • getColumnCount() 獲取列數(shù)

TableItem 已

  • getText(colIndex) 獲取列的文本 colIndex

例如:

Table table = .... the table


int rows = table.getItemCount();

int columns = table.getColumnCount();


for (int rowIndex = 0; rowIndex < rows; ++rowIndex) {

   TableItem rowItem = table.getItem(rowIndex);


   for (int colIndex = 0; colIndex < columns; ++colIndex) {

       String colValue = rowItem.getText(colIndex);


       ....

   }

}


查看完整回答
反對 回復(fù) 2021-08-25
  • 1 回答
  • 0 關(guān)注
  • 153 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)