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

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

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

JPanel.getLocationOnScreen介绍

暂无

代码示例

代码示例来源:origin: org.orbisgis/orbisgis-view

/**
 * On resize , the job list window must be moved
 *
 */
public void onJobPopupResize() {
    if (jobPopup != null) {
        Point labelLocation = jobListBar.getLocationOnScreen();
        jobPopup.setLocation(new Point(labelLocation.x, labelLocation.y - jobPopup.getContentPane().getHeight()));
    }
}

代码示例来源:origin: Exslims/MercuryTrade

private boolean withInPanel(JPanel panel) {
  return new Rectangle(panel.getLocationOnScreen(), panel.getSize()).contains(MouseInfo.getPointerInfo().getLocation());
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-sun-ddui

/** Enables to place this dialog in the middle of the given panel.
 *  @param panel where the dialog should be placed
 */
protected void setLocationInside(JPanel panel) {
  java.awt.Rectangle rect = this.getBounds();
  int width = rect.width;
  int height = rect.height;
  java.awt.Rectangle panelRect = panel.getBounds();
  if (width > panelRect.width || height > panelRect.height) {
    setLocationRelativeTo(panel);
  } else {
    java.awt.Point location = panel.getLocationOnScreen();
    setLocation(location.x + (panelRect.width - width) / 2, 
      location.y + (panelRect.height - height) / 2);
  }
}

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

_startPoint = _currentPanel.getLocationOnScreen();

代码示例来源:origin: uk.co.caprica/vlcj

private void syncVideoSurface() {
  if (frame.isVisible()) {
    // We re-size and re-position to the reference panel contained within the frame rather than the frame
    // itself, this makes it easy to add other UI elements without worrying about calculating the correct size
    // and position for the video surface ourselves - the referencePanel is in effect a "proxy" for the video
    // surface
    referencePanel.getBounds(bounds);
    bounds.setLocation(referencePanel.getLocationOnScreen());
    window.setBounds(bounds);
  }
}

相关文章

微信公众号

最新文章

更多

JPanel类方法