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

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

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

JButton.getLocationOnScreen介绍

暂无

代码示例

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

private void displayOverflow() {
  int x = getOrientation() == HORIZONTAL ? overflowButton.getLocationOnScreen().x : overflowButton.getLocationOnScreen().x + overflowButton.getWidth();
  int y = getOrientation() == HORIZONTAL ? overflowButton.getLocationOnScreen().y + overflowButton.getHeight() : overflowButton.getLocationOnScreen().y;
  popup.setLocation(x, y);
  popup.setVisible(true);
}

代码示例来源:origin: org.geotools/gt-widgets-swing-pending

private void actionMenu(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_actionMenu
  JPopupMenu menu = new JPopupMenu();
  menu.setLocation( jbu_action.getLocationOnScreen().x, jbu_action.getLocationOnScreen().y);
  
  JMenuItem mi = new JMenuItem("test");
  menu.add(mi);
  
  //menu.setVisible(true);
      
}//GEN-LAST:event_actionMenu

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

int minX = overflowButton.getLocationOnScreen().x;
int maxX_ob = minX + overflowButton.getWidth();
int maxX = getOrientation() == HORIZONTAL ? minX + popup.getWidth()
    : minX + overflowButton.getWidth() + popup.getWidth();
int minY = overflowButton.getLocationOnScreen().y;
int maxY_ob = minY + overflowButton.getHeight();
int maxY = getOrientation() == HORIZONTAL ? minY + overflowButton.getHeight() + popup.getHeight()

代码示例来源:origin: Waikato/weka-trunk

jd.getContentPane().add(p3, BorderLayout.NORTH);
jd.pack();
jd.setLocation(m_resampleBt.getLocationOnScreen().x,
 m_resampleBt.getLocationOnScreen().y - jd.getHeight());
jd.setVisible(true);

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

jd.getContentPane().add(p3, BorderLayout.NORTH);
jd.pack();
jd.setLocation(m_resampleBt.getLocationOnScreen().x,
 m_resampleBt.getLocationOnScreen().y - jd.getHeight());
jd.setVisible(true);

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

jd.setLocation(m_MoreOptions.getLocationOnScreen());
jd.setVisible(true);

代码示例来源:origin: sc.fiji/Simple_Neurite_Tracer

@Override
  public void actionPerformed(final ActionEvent e) {
    if (!swcTypesMenu.isVisible()) {
      final Point p = swcTypesButton.getLocationOnScreen();
      swcTypesMenu.setInvoker(swcTypesButton);
      swcTypesMenu.setLocation((int) p.getX(), (int) p.getY() + swcTypesButton.getHeight());
      swcTypesMenu.setVisible(true);
    } else {
      swcTypesMenu.setVisible(false);
    }
  }
});

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

jd.setLocation(m_selAttrib.getLocationOnScreen().x,
 m_selAttrib.getLocationOnScreen().y - jd.getHeight());
jd.setVisible(true);

代码示例来源:origin: Waikato/weka-trunk

jd.setLocation(m_selAttrib.getLocationOnScreen().x,
 m_selAttrib.getLocationOnScreen().y - jd.getHeight());
jd.setVisible(true);

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

Point los = button.getLocationOnScreen ();
preview.setSize ( width + 2, height + 2 );
preview.setLocation ( los.x - width - 2, los.y - height - 2 );

代码示例来源:origin: GoldenGnu/jeveassets

public void show() {
  Point point = jButton.getLocationOnScreen();
  jWindow.pack();
  jWindow.setLocation(point.x + 2, point.y + jButton.getHeight() - 1);
  jWindow.setVisible(true);
}

代码示例来源:origin: google/sagetv

fd.setDirectory(Sage.get("studio/last_image_browse_dir", System.getProperty("user.dir")));
fd.pack();
fd.setLocation(setImageFileButton.getLocationOnScreen());
fd.setVisible(true);
String selFilename = fd.getFile();

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

@Override
 public void actionPerformed(ActionEvent e) {
  EvaluationMetricSelectionDialog esd = new EvaluationMetricSelectionDialog(
    m_parent, m_evaluationMetrics);
  esd.setLocation(m_evalMetricsBut.getLocationOnScreen());
  esd.pack();
  esd.setVisible(true);
  m_evaluationMetrics = esd.getSelectedEvalMetrics();
 }
});

代码示例来源:origin: Waikato/weka-trunk

@Override
 public void actionPerformed(ActionEvent e) {
  EvaluationMetricSelectionDialog esd = new EvaluationMetricSelectionDialog(
    m_parent, m_evaluationMetrics);
  esd.setLocation(m_evalMetricsBut.getLocationOnScreen());
  esd.pack();
  esd.setVisible(true);
  m_evaluationMetrics = esd.getSelectedEvalMetrics();
 }
});

代码示例来源:origin: net.java.dev.laf-widget/laf-widget

Point buttonLocation = theButton.getLocationOnScreen();
Point popupLocation = new Point(
    (theButton.getWidth() - pref.width) / 2,

代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable

@Override
 public void actionPerformed(ActionEvent e) {
  EvaluationMetricSelectionDialog esd =
   new EvaluationMetricSelectionDialog(m_parent, m_evaluationMetrics);
  esd.setLocation(m_showEvalDialog.getLocationOnScreen());
  esd.pack();
  esd.setVisible(true);
  m_evaluationMetrics = esd.getSelectedEvalMetrics();
 }
});

代码示例来源:origin: Waikato/weka-trunk

@Override
 public void actionPerformed(ActionEvent e) {
  EvaluationMetricSelectionDialog esd =
   new EvaluationMetricSelectionDialog(m_parent, m_evaluationMetrics);
  esd.setLocation(m_showEvalDialog.getLocationOnScreen());
  esd.pack();
  esd.setVisible(true);
  m_evaluationMetrics = esd.getSelectedEvalMetrics();
 }
});

代码示例来源:origin: com.github.lgooddatepicker/LGoodDatePicker

@Override
  public void mouseReleased(MouseEvent event) {
    // Do nothing if the mouse was released inside the toggle button.
    Point mousePositionOnScreen = MouseInfo.getPointerInfo().getLocation();
    Rectangle toggleBoundsOnScreen = getComponentToggleTimeMenuButton().getBounds();
    toggleBoundsOnScreen.setLocation(getComponentToggleTimeMenuButton().getLocationOnScreen());
    if (toggleBoundsOnScreen.contains(mousePositionOnScreen)) {
      return;
    }
    if (timeMenuPanel != null) {
      timeMenuPanel.mouseReleasedFromToggleButtonOutsideButton();
    }
  }
});

代码示例来源:origin: com.jidesoft/jide-oss

Dimension size = _tabListPopup.getPreferredSize();
Rectangle bounds = listButton.getBounds();
Point p = listButton.getLocationOnScreen();
bounds.x = p.x;
bounds.y = p.y;

代码示例来源:origin: com.github.lgooddatepicker/LGoodDatePicker

this, settings.getBorderCalendarPopup());
int defaultX = toggleCalendarButton.getLocationOnScreen().x
    + toggleCalendarButton.getBounds().width - popup.getBounds().width - 2;
int defaultY = toggleCalendarButton.getLocationOnScreen().y
    + toggleCalendarButton.getBounds().height + 2;

相关文章

JButton类方法