javax.swing.JButton.getLocation()方法的使用及代码示例

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

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

JButton.getLocation介绍

暂无

代码示例

代码示例来源:origin: sensepost/yeti

private void btnDomainMenuMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnDomainMenuMouseClicked
  pmDomain.show(tbMenu, (int) btnDomainMenu.getLocation().getX(), btnDomainMenu.getLocation().y + btnDomainMenu.getHeight());
}//GEN-LAST:event_btnDomainMenuMouseClicked

代码示例来源:origin: sensepost/yeti

private void btnHostMenuMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnHostMenuMouseClicked
  pmHostEnum.show(tbMenu, (int) btnHostMenu.getLocation().getX(), btnHostMenu.getLocation().y + btnHostMenu.getHeight());
}//GEN-LAST:event_btnHostMenuMouseClicked

代码示例来源:origin: sensepost/yeti

private void btnGroupByMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnGroupByMouseClicked
  pmGroup.show(jPanel2, (int) btnGroupBy.getLocation().getX(), btnGroupBy.getLocation().y + btnGroupBy.getHeight());
}//GEN-LAST:event_btnGroupByMouseClicked

代码示例来源:origin: sensepost/yeti

private void btnShowMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnShowMouseClicked
  pmHide.show(jPanel2, (int) btnShow.getLocation().getX(), btnShow.getLocation().y + btnShow.getHeight());
}//GEN-LAST:event_btnShowMouseClicked

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction(jsDoc = LEFT_JSDOC)
@Override
public int getLeft() {
  return super.getLocation().x;
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction(jsDoc = TOP_JSDOC)
@Override
public int getTop() {
  return super.getLocation().y;
}

代码示例来源:origin: stackoverflow.com

//b1.setLocation(location,100);
JButton button = (JButton)e.getSource();
button.setLocation(button.getLocation() + 10, 100);

代码示例来源:origin: sensepost/yeti

private void btnCollectorsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCollectorsActionPerformed
  pmCollectors.removeAll();
  for (JMenuItem mi : collectorPlugins.getPlugins()) {
    mi.addActionListener(new java.awt.event.ActionListener() {
      @Override
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        pluginMenuEvent(evt);
      }
    });
    pmCollectors.add(mi);
  }
  pmCollectors.show(tbMenu, (int) btnCollectors.getLocation().getX(), btnCollectors.getLocation().y + btnCollectors.getHeight());
}//GEN-LAST:event_btnCollectorsActionPerformed

代码示例来源:origin: de.dfki.mary/marytts-client

public void actionPerformed(ActionEvent e) {
    if (!isHelpWindowOpen) {
      isHelpWindowOpen = true;
      helpWindow = new JFrame("Help: " + chkEnabled.getText() + " Effect");
      JTextArea helpTextArea = new JTextArea(data.getHelpText());
      helpTextArea.setEditable(false);
      helpWindow.getContentPane().add(helpTextArea, BorderLayout.WEST);
      helpWindow.pack();
      helpWindow.setLocation(btnHelp.getLocation().x, btnHelp.getLocation().y);
      helpWindow.setVisible(true);
      helpWindow.addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(WindowEvent winEvt) {
          // Perhaps ask user if they want to save any unsaved files first.
          isHelpWindowOpen = false;
        }
      });
    } else {
      if (helpWindow != null)
        helpWindow.requestFocus();
    }
  }
});

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

@Override
  public void actionPerformed(ActionEvent e) {
    parent.showContextMenu(
        SwingUtilities.convertPoint(cell, cell.settingsButton.getLocation(),
            parent.scrollPane));
  }
});

代码示例来源:origin: senbox-org/snap-desktop

void adjustDimension(JButton component) {
  FontMetrics metrics = component.getFontMetrics(component.getFont());
  int width = metrics.stringWidth(component.getText());
  component.setPreferredSize(new Dimension(width + 32, controlHeight));
  component.setBounds(new Rectangle(component.getLocation(), component.getPreferredSize()));
}

代码示例来源:origin: stackoverflow.com

e1.printStackTrace();
toolTip.setBounds(b.getLocation().x+b.getWidth(), b.getLocation().y-b.getHeight(), 100, 50);
f.add(toolTip);
f.repaint();

代码示例来源:origin: triplea-game/triplea

HeadlessAutoSaveType.AFTER_NON_COMBAT_MOVE));
menu.add(clientModelForHostBots.getHostBotGetGameSaveClientAction(GameSelectorPanel.this));
final Point point = loadSavedGame.getLocation();
menu.show(GameSelectorPanel.this, point.x + loadSavedGame.getWidth(), point.y);

代码示例来源:origin: it.unibo.alchemist/alchemist-swingui

final EffectBuilder eb = new EffectBuilder();
eb.pack();
final Point location = addEffectButton.getLocation();
SwingUtilities.convertPointToScreen(location, addEffectButton);
eb.setLocation(location);

相关文章

JButton类方法