本文整理了Java中javax.swing.table.TableModel.getValueAt()
方法的一些代码示例,展示了TableModel.getValueAt()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableModel.getValueAt()
方法的具体详情如下:
包路径:javax.swing.table.TableModel
类名称:TableModel
方法名:getValueAt
暂无
代码示例来源:origin: igniterealtime/Smack
@Override
public void valueChanged(ListSelectionEvent e) {
if (table.getSelectedRow() == -1) {
// Clear the messageTextArea since there is none packet selected
messageTextArea.setText(null);
}
else {
// Set the detail of the packet in the messageTextArea
messageTextArea.setText(
(String) table.getModel().getValueAt(table.getSelectedRow(), 0));
// Scroll up to the top
messageTextArea.setCaretPosition(0);
}
}
}
代码示例来源:origin: pmd/pmd
private void populateResultArea() {
int[] selectionIndices = resultsTable.getSelectedRows();
TableModel model = resultsTable.getModel();
List<Match> selections = new ArrayList<>(selectionIndices.length);
for (int i = 0; i < selectionIndices.length; i++) {
selections.add((Match) model.getValueAt(selectionIndices[i], 99));
}
String report = new SimpleRenderer(trimLeadingWhitespace).render(selections.iterator());
resultsTextArea.setText(report);
resultsTextArea.setCaretPosition(0); // move to the top
}
代码示例来源:origin: libgdx/libgdx
@Override
public void tableChanged (TableModelEvent e) {
int row = e.getFirstRow();
int column = e.getColumn();
if (column == 0) {
ExternalExtension extension = ((ExtensionTableModel)table.getModel()).getExtension(row);
Dependency dep = extension.generateDependency();
boolean selected = (Boolean)table.getModel().getValueAt(row, 0);
if (selected) {
if (!mainDependencies.contains(dep)) {
mainDependencies.add(dep);
}
} else {
mainDependencies.remove(dep);
}
}
}
代码示例来源:origin: log4j/log4j
Object obj = _table.getModel().getValueAt(selectedRow, i);
if (obj != null) {
value = obj.toString();
Object obj = _table.getModel().getValueAt(selectedRow, _numCols - 1);
if (obj != null) {
buf.append(obj.toString());
代码示例来源:origin: stackoverflow.com
super(ALL);
this.table = table;
this.tableModel = table.getModel();
if (tableModel.getColumnClass(targetColumn) != Boolean.class) {
throw new IllegalArgumentException("Boolean column required.");
boolean allFalse = true;
for (int r = 0; r < tableModel.getRowCount(); r++) {
boolean b = (Boolean) tableModel.getValueAt(r, targetColumn);
allTrue &= b;
allFalse &= !b;
代码示例来源: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: camunda/camunda-bpm-platform
Object obj = _table.getModel().getValueAt(selectedRow, i);
if (obj != null) {
value = obj.toString();
Object obj = _table.getModel().getValueAt(selectedRow, _numCols - 1);
if (obj != null) {
buf.append(obj.toString());
代码示例来源:origin: winder/Universal-G-Code-Sender
@Override
public void run()
{
row = table.convertRowIndexToModel( table.getEditingRow() );
column = table.convertColumnIndexToModel( table.getEditingColumn() );
oldValue = table.getModel().getValueAt(row, column);
newValue = null;
}
代码示例来源:origin: winder/Universal-G-Code-Sender
private void processEditingStopped()
{
newValue = table.getModel().getValueAt(row, column);
// The data has changed, invoke the supplied Action
if (! newValue.equals(oldValue))
{
// Make a copy of the data in case another cell starts editing
// while processing this change
TableCellListener tcl = new TableCellListener(
getTable(), getRow(), getColumn(), getOldValue(), getNewValue());
ActionEvent event = new ActionEvent(
tcl,
ActionEvent.ACTION_PERFORMED,
"");
action.actionPerformed(event);
}
}
}
代码示例来源:origin: ron190/jsql-injection
TableModel model = table.getModel();
if (model.getValueAt(i, j) == null) {
excel.write("\t");
excel.write(model.getValueAt(i, j).toString().replaceAll("\n", "\\n").replaceAll("\t", "\\t") + "\t");
代码示例来源:origin: stackoverflow.com
int modelColumn = convertColumnIndexToModel(column);
if (modelColumn == 1) {
Class rowClass = getModel().getValueAt(row, modelColumn).getClass();
return getDefaultRenderer(rowClass);
} else {
int modelColumn = convertColumnIndexToModel(column);
if (modelColumn == 1) {
editingClass = getModel().getValueAt(row, modelColumn).getClass();
return getDefaultEditor(editingClass);
} else {
代码示例来源:origin: stackoverflow.com
boolean type = (Boolean) getModel().getValueAt(modelRow, 2);
boolean type1 = (Boolean) getModel().getValueAt(modelRow, 3);
boolean type2 = (Boolean) getModel().isCellEditable(row, column);
comp.setForeground(Color.black);
if ((type) && (!type1)) {
代码示例来源:origin: stackoverflow.com
Object value, boolean isSelected, boolean hasFocus, int row, int col) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);
String status = (String)table.getModel().getValueAt(row, STATUS_COL);
if ("active".equals(status)) {
setBackground(Color.BLACK);
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javafx2-project
Map<String,String> getResources() {
final TableModel model = this.tableCallbacks.getModel();
final Map<String,String> result = new TreeMap<String,String>();
for (int i = 0; i < model.getRowCount(); i++) {
if (model.getValueAt(i, 0) != null && !((String)model.getValueAt(i, 0)).isEmpty()) {
result.put((String)model.getValueAt(i, 0), (String)model.getValueAt(i, 1));
}
}
return result;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javafx2-project
List<File> getResources() {
final TableModel model = this.tableDownloadMode.getModel();
final List<File> result = new LinkedList<File>();
for (int i=0; i< model.getRowCount(); i++) {
if ((Boolean)model.getValueAt(i, 1)) {
result.add((File)model.getValueAt(i, 0));
}
}
return result;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-spring-beans
public String[] getIncludedNamespaces() {
List<String> incs = new ArrayList<String>();
TableModel model = includesTable.getModel();
for(int i = 0; i < model.getRowCount(); i++) {
Boolean selected = (Boolean) model.getValueAt(i, 0);
if(selected != null && selected == Boolean.TRUE) {
String namespace = (String) model.getValueAt(i, 1);
incs.add(namespace);
}
}
return incs.toArray(new String[0]);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject
private ArrayList<String> getDlls(){
ArrayList<String> dlls = new ArrayList<>();
if (((ProjectKindItem)dependeciesComboBox.getSelectedItem()).kind == IteratorExtension.ProjectKind.Minimal) {
return dlls;
}
for(int i = 0; i < table.getModel().getRowCount(); i++) {
if ((Boolean)table.getModel().getValueAt(i, 0)){
dlls.add((String)table.getModel().getValueAt(i, 2));
}
}
return dlls;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-identity-profile-api
public Object getValue() {
int[] indices = table.getSelectedRows();
ArrayList<String> rows = new ArrayList<String>();
TableModel model = table.getModel();
for (int i : indices) {
rows.add((String) model.getValueAt(i, 0));
}
return rows;
}
代码示例来源:origin: org.owasp.jbrofuzz/jbrofuzz
public void actionPerformed(final ActionEvent aEvent) {
final int selRow = area.getSelectedRow();
final String value = (String) area.getModel().getValueAt(selRow, 0);
final StringSelection ss = new StringSelection(value);
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(
ss, null);
}
});
代码示例来源:origin: freeplane/freeplane
/**
*/
protected NodeModel getMindMapNode(final int row) {
final NodeModel selectedNode = ((TextHolder) tableView.getModel().getValueAt(row,
nodeTextColumn)).getNode();
return selectedNode;
}
内容来源于网络,如有侵权,请联系作者删除!