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

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

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

JButton.getLocation介绍

暂无

代码示例

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

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

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

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

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

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

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

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

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

  1. @ScriptFunction(jsDoc = LEFT_JSDOC)
  2. @Override
  3. public int getLeft() {
  4. return super.getLocation().x;
  5. }

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

  1. @ScriptFunction(jsDoc = TOP_JSDOC)
  2. @Override
  3. public int getTop() {
  4. return super.getLocation().y;
  5. }

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

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

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

  1. private void btnCollectorsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCollectorsActionPerformed
  2. pmCollectors.removeAll();
  3. for (JMenuItem mi : collectorPlugins.getPlugins()) {
  4. mi.addActionListener(new java.awt.event.ActionListener() {
  5. @Override
  6. public void actionPerformed(java.awt.event.ActionEvent evt) {
  7. pluginMenuEvent(evt);
  8. }
  9. });
  10. pmCollectors.add(mi);
  11. }
  12. pmCollectors.show(tbMenu, (int) btnCollectors.getLocation().getX(), btnCollectors.getLocation().y + btnCollectors.getHeight());
  13. }//GEN-LAST:event_btnCollectorsActionPerformed

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

  1. public void actionPerformed(ActionEvent e) {
  2. if (!isHelpWindowOpen) {
  3. isHelpWindowOpen = true;
  4. helpWindow = new JFrame("Help: " + chkEnabled.getText() + " Effect");
  5. JTextArea helpTextArea = new JTextArea(data.getHelpText());
  6. helpTextArea.setEditable(false);
  7. helpWindow.getContentPane().add(helpTextArea, BorderLayout.WEST);
  8. helpWindow.pack();
  9. helpWindow.setLocation(btnHelp.getLocation().x, btnHelp.getLocation().y);
  10. helpWindow.setVisible(true);
  11. helpWindow.addWindowListener(new java.awt.event.WindowAdapter() {
  12. public void windowClosing(WindowEvent winEvt) {
  13. // Perhaps ask user if they want to save any unsaved files first.
  14. isHelpWindowOpen = false;
  15. }
  16. });
  17. } else {
  18. if (helpWindow != null)
  19. helpWindow.requestFocus();
  20. }
  21. }
  22. });

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

  1. @Override
  2. public void actionPerformed(ActionEvent e) {
  3. parent.showContextMenu(
  4. SwingUtilities.convertPoint(cell, cell.settingsButton.getLocation(),
  5. parent.scrollPane));
  6. }
  7. });

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

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

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

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

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

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

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

  1. final EffectBuilder eb = new EffectBuilder();
  2. eb.pack();
  3. final Point location = addEffectButton.getLocation();
  4. SwingUtilities.convertPointToScreen(location, addEffectButton);
  5. eb.setLocation(location);

相关文章

JButton类方法