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

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

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

JTable.requestFocusInWindow介绍

暂无

代码示例

代码示例来源:origin: marytts/marytts

private void formFocusGained(java.awt.event.FocusEvent evt) {// GEN-FIRST:event_formFocusGained
  jTable_PromptSet.requestFocusInWindow();
}// GEN-LAST:event_formFocusGained

代码示例来源:origin: marytts/marytts

/**
 * Creates new form AdminWindow and starts the recording session
 * 
 * @param voiceFolderPathString
 *            voiceFolderPathString
 */
public AdminWindow(String voiceFolderPathString) {
  this.voiceFolderPathString = voiceFolderPathString;
  optionsDialog = new Options(this);
  setSystemLookAndFeel();
  System.out.println("Initializing components...");
  // GUI form setup
  initComponents(); // Initialize GUI components (auto-generated code)
  initMoreComponents(); // Initialize some components further (editable)
  setupVoice();
  jTable_PromptSet.requestFocusInWindow();
  Test.output("|AdminWindow| Ready for testing."); // TESTCODE
}

代码示例来源:origin: ron190/jsql-injection

@Override
public void actionPerformed(ActionEvent e) {
  this.textFilter.setText(null);
  this.panelSearch.setVisible(false);
  this.panelTable.getTableValues().requestFocusInWindow();
}

代码示例来源:origin: ron190/jsql-injection

@Override
  public void mousePressed(MouseEvent e) {
    PanelTable.this.tableValues.requestFocusInWindow();
    if (SwingUtilities.isRightMouseButton(e)) {
      /**
       * Keep selection when multiple cells are selected,
       * move focus only
       */
      Point p = e.getPoint();
      int rowNumber = PanelTable.this.tableValues.rowAtPoint(p);
      int colNumber = PanelTable.this.tableValues.columnAtPoint(p);
      DefaultListSelectionModel modelRow = (DefaultListSelectionModel) PanelTable.this.tableValues
          .getSelectionModel();
      DefaultListSelectionModel modelColumn = (DefaultListSelectionModel) PanelTable.this.tableValues
          .getColumnModel().getSelectionModel();
      modelRow.moveLeadSelectionIndex(rowNumber);
      modelColumn.moveLeadSelectionIndex(colNumber);
    }
  }
});

代码示例来源:origin: ron190/jsql-injection

@Override
  public void mousePressed(MouseEvent e) {
    PanelConsoles.this.networkTable.requestFocusInWindow();
    // move selected row and place cursor on focused cell
    if (SwingUtilities.isRightMouseButton(e)) {
      Point p = e.getPoint();
      // get the row index that contains that coordinate
      int rowNumber = PanelConsoles.this.networkTable.rowAtPoint(p);
      int colNumber = PanelConsoles.this.networkTable.columnAtPoint(p);
      // Get the ListSelectionModel of the JTable
      DefaultListSelectionModel  model = (DefaultListSelectionModel) PanelConsoles.this.networkTable.getSelectionModel();
      DefaultListSelectionModel  model2 = (DefaultListSelectionModel) PanelConsoles.this.networkTable.getColumnModel().getSelectionModel();
      PanelConsoles.this.networkTable.setRowSelectionInterval(rowNumber, rowNumber);
      model.moveLeadSelectionIndex(rowNumber);
      model2.moveLeadSelectionIndex(colNumber);
    }
  }
});

代码示例来源:origin: org.zaproxy/zap

@Override
public void setSelected(boolean selected) {
  if (selected) {
    tableBody.requestFocusInWindow();
  }
}

代码示例来源:origin: org.zaproxy/zap

@Override
public void setSelected(boolean selected) {
  if (selected) {
    table.requestFocusInWindow();
  }
}

代码示例来源:origin: org.zaproxy/zap

@Override
public void setSelected(boolean selected) {
  if (selected) {
    hexTableBody.requestFocusInWindow();
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javafx2-project

private void buttonAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonAddActionPerformed
  tableModel.addRow();
  tableMultiProperties.requestFocusInWindow();
  //tableParams.changeSelection(WIDTH, WIDTH, true, true);
}//GEN-LAST:event_buttonAddActionPerformed

代码示例来源:origin: freeplane/freeplane

@Override
  public void keyPressed(final KeyEvent pEvent) {
    if (pEvent.getKeyCode() == KeyEvent.VK_DOWN) {
      tableView.requestFocusInWindow();
    }
    else if (pEvent.getKeyCode() == KeyEvent.VK_UP) {
      mFilterTextSearchField.requestFocusInWindow();
    }
  }
});

代码示例来源:origin: otros-systems/otroslogviewer

@Override
 public void actionPerformed(ActionEvent e) {
  tableFiles.requestFocusInWindow();
  if (tableFiles.getSelectedRow() < 0 && tableFiles.getRowCount() == 0) {
   tableFiles.getSelectionModel().setSelectionInterval(0, 0);
  }
 }
};

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-javafx2-project

private void buttonRemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonRemoveActionPerformed
  int selIndex = tableMultiProperties.getSelectedRow();
  if (selIndex != -1) {
    tableModel.removeRow(selIndex);
    tableMultiProperties.requestFocusInWindow();
  }
}//GEN-LAST:event_buttonRemoveActionPerformed

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-debugger-common2

@Override
public void requestActive() {
  super.requestActive();
  tab.requestFocusInWindow();
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-webui-designtime

private void newActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newActionPerformed
  ItemsTableModel tableModel = (ItemsTableModel)dataTable.getModel();
  if (tableModel.canAddRow()) {
    tableModel.addRow();
    dataTable.setModel(tableModel);
    dataTable.changeSelection(tableModel.getRowCount() - 1, 0, false, false);
    dataTable.requestFocusInWindow();
    
    // Let's not call this. This makes the new row acting very weird. -dongmei
    //dataTable.editCellAt(tableModel.getRowCount() - 1, ItemsTableModel.DISPLAY_COLUMN);
  }
}//GEN-LAST:event_newActionPerformed

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-propertyeditors

private void newActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newActionPerformed
  TableModelSupport tableModel = (TableModelSupport)dataTable.getModel();
  if (tableModel.canAddRow()) {
    tableModel.addRow();
    dataTable.setModel(tableModel);
    dataTable.changeSelection(tableModel.getRowCount() - 1, 0, false, false);
    dataTable.requestFocusInWindow();
    
    // Let's not call this. This makes the new row acting very weird. -dongmei
    //dataTable.editCellAt(tableModel.getRowCount() - 1, 0);
  }
}//GEN-LAST:event_newActionPerformed

代码示例来源:origin: tflobbe/solrmeter

public void showResults(QueryResponse response) {
 jScrollPaneError.setVisible(false);
 outputPanel.setVisible(true);
 jLabelQueryTime.setText(I18n.get("queryPanel.queryTime") + " " + response.getQTime() + " ms");
 jLabelResultsFound.setText(I18n.get("queryPanel.resultsFound") + " " + response.getResults().getNumFound());
 this.setFacets(response.getFacetFields());
 resultsTableModel.setResponse(response);
 jTableResults.setModel(resultsTableModel);
 jTableResults.doLayout();
 jTableResults.requestFocusInWindow();
 resultsTableModel.fireTableStructureChanged();
 resultsTableModel.fireTableDataChanged();
 this.revalidate();
}

代码示例来源:origin: org.netbeans.api/org-openide-explorer

/** The old window system will force focus back to the table, when an editor
 * becomes visible.  This will cause the combo box to close its popup because
 * it has lost focus, unless we intervene here and make sure focus must be
 * passed directly to the editor if present */
public final boolean requestFocusInWindow() {
  if (isEditing()) {
    if (PropUtils.isLoggable(BaseTable.class)) {
      PropUtils.log(BaseTable.class, "RequestFocusInWindow on table delegating to editor"); //NOI18N
    }
    return editorComp.requestFocusInWindow();
  } else {
    if (!inEditorChangeRequest()) {
      if (PropUtils.isLoggable(BaseTable.class)) {
        PropUtils.log(BaseTable.class, "RequestFocusInWindow on table with no editor present"); //NOI18N
      }
      boolean result = super.requestFocusInWindow();
      if (PropUtils.isLoggable(BaseTable.class)) {
        PropUtils.log(BaseTable.class, "  RequestFocusInWindow result " + result); //NOI18N
      }
      return result;
    } else {
      return false;
    }
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** The old window system will force focus back to the table, when an editor
 * becomes visible.  This will cause the combo box to close its popup because
 * it has lost focus, unless we intervene here and make sure focus must be
 * passed directly to the editor if present */
public final boolean requestFocusInWindow() {
  if (isEditing()) {
    if (PropUtils.isLoggable(BaseTable.class)) {
      PropUtils.log(BaseTable.class, "RequestFocusInWindow on table delegating to editor"); //NOI18N
    }
    return editorComp.requestFocusInWindow();
  } else {
    if (!inEditorChangeRequest()) {
      if (PropUtils.isLoggable(BaseTable.class)) {
        PropUtils.log(BaseTable.class, "RequestFocusInWindow on table with no editor present"); //NOI18N
      }
      boolean result = super.requestFocusInWindow();
      if (PropUtils.isLoggable(BaseTable.class)) {
        PropUtils.log(BaseTable.class, "  RequestFocusInWindow result " + result); //NOI18N
      }
      return result;
    } else {
      return false;
    }
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** The old window system will force focus back to the table, when an editor
 * becomes visible.  This will cause the combo box to close its popup because
 * it has lost focus, unless we intervene here and make sure focus must be
 * passed directly to the editor if present */
public final boolean requestFocusInWindow() {
  if (isEditing()) {
    if (PropUtils.isLoggable(BaseTable.class)) {
      PropUtils.log(BaseTable.class, "RequestFocusInWindow on table delegating to editor"); //NOI18N
    }
    return editorComp.requestFocusInWindow();
  } else {
    if (!inEditorChangeRequest()) {
      if (PropUtils.isLoggable(BaseTable.class)) {
        PropUtils.log(BaseTable.class, "RequestFocusInWindow on table with no editor present"); //NOI18N
      }
      boolean result = super.requestFocusInWindow();
      if (PropUtils.isLoggable(BaseTable.class)) {
        PropUtils.log(BaseTable.class, "  RequestFocusInWindow result " + result); //NOI18N
      }
      return result;
    } else {
      return false;
    }
  }
}

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

t_.clearSelection();
} else {
 t_.requestFocusInWindow();
 t_.requestFocus();
 final ListSelectionModel m = t_.getSelectionModel();

相关文章

JTable类方法