本文整理了Java中javax.swing.table.TableModel.getRowCount()
方法的一些代码示例,展示了TableModel.getRowCount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableModel.getRowCount()
方法的具体详情如下:
包路径:javax.swing.table.TableModel
类名称:TableModel
方法名:getRowCount
暂无
代码示例来源:origin: log4j/log4j
protected static boolean contains(int row, TableModel model) {
if (model == null) {
return false;
}
if (row < 0) {
return false;
}
if (row >= model.getRowCount()) {
return false;
}
return true;
}
代码示例来源:origin: groovy/groovy-core
/**
* Provide the standard Groovy <code>size()</code> method for <code>TableModel</code>.
*
* @param self a TableModel
* @return the row count of the TableModel
* @since 1.6.4
*/
public static int size(TableModel self) {
return self.getRowCount();
}
代码示例来源:origin: groovy/groovy-core
public void reallocateIndexes() {
int rowCount = model.getRowCount();
// Set up a new array of indexes with the right number of elements
// for the new data model.
indexes = new int[rowCount];
// Initialise with the identity mapping.
for (int row = 0; row < rowCount; row++)
indexes[row] = row;
}
代码示例来源:origin: groovy/groovy-core
public boolean hasNext() {
return row < self.getRowCount();
}
代码示例来源:origin: groovy/groovy-core
public int getRowCount() {
return (model == null) ? 0 : model.getRowCount();
}
代码示例来源:origin: groovy/groovy-core
public void checkModel() {
if (indexes.length != model.getRowCount()) {
System.err.println("Sorter not informed of a change in model.");
}
}
代码示例来源:origin: redwarp/9-Patch-Resizer
@Override
public void actionPerformed(ActionEvent e) {
MainWindow.this.resultTable.clear();
if (MainWindow.this.resultTable.getModel().getRowCount() == 0) {
MainWindow.this.mntmClear.setEnabled(false);
CardLayout layout = (CardLayout) MainWindow.this
.getContentPane().getLayout();
layout.show(MainWindow.this.getContentPane(), "input");
}
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
protected static boolean contains(int row, TableModel model) {
if (model == null) {
return false;
}
if (row < 0) {
return false;
}
if (row >= model.getRowCount()) {
return false;
}
return true;
}
代码示例来源:origin: stackoverflow.com
boolean allTrue = true;
boolean allFalse = true;
for (int r = 0; r < tableModel.getRowCount(); r++) {
boolean b = (Boolean) tableModel.getValueAt(r, targetColumn);
allTrue &= b;
代码示例来源:origin: magefree/mage
public static int getModelRowFromView(JTable table, int viewRow) {
if (viewRow != -1 && viewRow < table.getModel().getRowCount()) {
return table.convertRowIndexToModel(viewRow);
}
return -1;
}
代码示例来源:origin: magefree/mage
public static int getViewRowFromModel(JTable table, int modelRow) {
if (modelRow != -1 && modelRow < table.getModel().getRowCount()) {
return table.convertRowIndexToView(modelRow);
}
return -1;
}
}
代码示例来源:origin: pentaho/mondrian
private void acceptButtonActionPerformed(ActionEvent evt) {
TableModel tm = jTable1.getModel();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < tm.getRowCount(); i++) {
Boolean selected = (Boolean) tm.getValueAt(i, 0);
if (selected) {
if (sb.length() > 0) {
sb.append(",");
}
sb.append((String) tm.getValueAt(i, 1));
}
}
selectedSchemaString = sb.toString();
accepted = true;
setVisible(false);
dispose();
}
代码示例来源:origin: RaiMan/SikuliX2
protected void resetLineCol() {
for (int n = 0; n < getModel().getRowCount(); n++) {
((ScriptTableModel) getModel()).cellUpdated(n, 0);
}
}
}
代码示例来源:origin: ron190/jsql-injection
for (int i = 0 ; i < model.getRowCount() ; i++) {
for (int j = 2 ; j < model.getColumnCount() ; j++) {
代码示例来源:origin: stackoverflow.com
TableModel model = table.getModel();
for(int i = 0; i < model.getRowCount(); i++) {
if((Boolean)model.getValueAt(i, 0)) {
// delete the row
}
}
代码示例来源:origin: stackoverflow.com
int getRowByValue(TableModel model, Object value) {
for (int i = model.getRowCount() - 1; i >= 0; --i) {
for (int j = model.getColumnCount() - 1; j >= 0; --j) {
if (model.getValueAt(i, j).equals(value)) {
// what if value is not unique?
return i;
}
}
}
}
代码示例来源:origin: freeplane/freeplane
private void selectLastAddOn(JComponent managementPanel) {
try {
JTable table = findJTable(managementPanel);
final int row = table.getModel().getRowCount() - 1;
table.getSelectionModel().setSelectionInterval(row, row);
}
catch (Exception e) {
LogUtils.warn("cannot select just installed add-on", e);
}
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
@Override
public void writeSettings(Properties p, int index, String propertyPrefix) {
super.writeSettings(p, index, propertyPrefix);
TableModel model = getModel();
if (model.getRowCount() > 0 && getModelIndex () > 0) {
String shortDescription = rowModel.getShortDescription(getModelIndex () - 1);
String myPrefix = propertyPrefix + PROP_PREFIX + Integer.toString(index) + "-";
p.setProperty(myPrefix + PROP_SHORT_DESCRIPTION, shortDescription);
}
}
代码示例来源:origin: mucommander/mucommander
/**
* Returns the table's preferred size.
*/
@Override
public Dimension getPreferredSize() {return new Dimension(getIconWidth() + 2 * getLabelWidth(), getModel().getRowCount()*getRowHeight());}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
public String getRawColumnName () {
TableModel model = getModel();
if (model.getRowCount() <= 0) {
return null;
}
if (getModelIndex () == 0) {
return null;
}
return rowModel.getRawColumnName (getModelIndex () - 1);
}
内容来源于网络,如有侵权,请联系作者删除!