javax.swing.JTable.getSelectedColumnCount()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(200)

本文整理了Java中javax.swing.JTable.getSelectedColumnCount()方法的一些代码示例,展示了JTable.getSelectedColumnCount()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTable.getSelectedColumnCount()方法的具体详情如下:
包路径:javax.swing.JTable
类名称:JTable
方法名:getSelectedColumnCount

JTable.getSelectedColumnCount介绍

暂无

代码示例

代码示例来源:origin: digital-preservation/droid

@Override
  public void keyPressed(KeyEvent e) {
    if (e.getKeyCode() == KeyEvent.VK_ENTER && table.getSelectedColumnCount() == 1) {
      exploreTableFolder(table.getSelectedRow());
    }
  }
});

代码示例来源:origin: uk.gov.nationalarchives/droid-ui

@Override
  public void keyPressed(KeyEvent e) {
    if (e.getKeyCode() == KeyEvent.VK_ENTER && table.getSelectedColumnCount() == 1) {
      exploreTableFolder(table.getSelectedRow());
    }
  }
});

代码示例来源:origin: omegat-org/omegat

@Override
  public void keyReleased(KeyEvent evt) {
    if (evt.getKeyCode() == KeyEvent.VK_DELETE || evt.getKeyCode() == KeyEvent.VK_BACK_SPACE) {
      if (panel.selCharTable.getSelectedColumnCount() < 1) {
        return;
      }
      int row1 = panel.selCharTable.getSelectedRow();
      int col1 = panel.selCharTable.getSelectedColumn();
      int row2 = panel.selCharTable.getSelectedRowCount() + row1 - 1;
      int col2 = panel.selCharTable.getSelectedColumnCount() + col1 - 1;
      selCharModel.removeSelection(row1, col1, row2, col2);
    }
  }
});

代码示例来源:origin: joel-costigliola/assertj-swing

@RunsInCurrentThread
static boolean hasSelection(@Nonnull JTable table) {
 return table.getSelectedRowCount() > 0 || table.getSelectedColumnCount() > 0;
}

代码示例来源:origin: com.github.haifengl/smile-plot

int numcols = table.getSelectedColumnCount();
int numrows = table.getSelectedRowCount();
int[] rowsselected = table.getSelectedRows();

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public void valueChanged(ListSelectionEvent _evt)
{
 Object source=_evt.getSource();
 if(source==this)
 {
  if(table_.getColumnSelectionAllowed()&&
    (table_.getSelectedColumnCount()==0))
  {
   table_.setColumnSelectionInterval(0,table_.getColumnCount()-1);
  }
 }
}

代码示例来源:origin: GoldenGnu/jeveassets

public JMenu getMenu(final JTable jTable, final List<E> items) {
  String text = null;
  EnumTableColumn<?> column = null;
  boolean isNumeric = false;
  boolean isDate = false;
  int columnIndex = jTable.getSelectedColumn();
  if (jTable.getSelectedColumnCount() == 1 //Single cell (column)
      && jTable.getSelectedRowCount() == 1 //Single cell (row)
      && items.size() == 1 //Single element
      && !(items.get(0) instanceof SeparatorList.Separator) //Not Separator
      && columnIndex >= 0 //Shown column
      && columnIndex < getShownColumns().size()) { //Shown column
    column = getShownColumns().get(columnIndex);
    isNumeric = isNumeric(column);
    isDate = isDate(column);
    text = FilterMatcher.format(getColumnValue(items.get(0), column.name()), false);
  }
  return new FilterMenu<E>(gui, column, text, isNumeric, isDate);
}

相关文章

JTable类方法