javax.swing.JLabel.getX()方法的使用及代码示例

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

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

JLabel.getX介绍

暂无

代码示例

代码示例来源:origin: javax.help/javahelp

private int getLabelStart() {
return title.getX() - 1;
}

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

public boolean intersects(JLabel testa, JLabel testb){
  Rectangle rectB = testb.getBounds();

  Rectangle result = SwingUtilities.computeIntersection(testa.getX(), testa.getY(), testa.getWidth(), testa.getHeight(), rectB);

  return (result.getWidth() > 0 && result.getHeight() > 0);
}

代码示例来源:origin: com.github.insubstantial/flamingo

@Override
public Point getKeyTipAnchorCenterPoint() {
  if (this.ribbonComponent.isSimpleWrapper()) {
    return new Point(
        this.ribbonComponent.getMainComponent().getX() + 10,
        this.ribbonComponent.getHeight());
  } else {
    return new Point(this.captionLabel.getX(), this.ribbonComponent
        .getHeight());
  }
}

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

int deltaX = e.getX() - mousePressedPoint.x;
int deltaY = e.getY() - mousePressedPoint.y;
label.setLocation(label.getX() + deltaX, label.getY() + deltaY);

代码示例来源:origin: org.gosu-lang.gosu/gosu-lab

public void paintComponent( Graphics g )
{
 _image.paintIcon( this, g, getInsets().left, getInsets().top );
 g.translate( _label.getX(), _label.getY() );
 _label.paint( g );
}

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

int x = character.getX() + character.getWidth();
int y = character.getY() + ((character.getHeight() - fireBall.getHeight()) / 2);
fireBall.setLocation(x, y);

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

tempLabel.setBounds(tChild.titleLabel.getBounds());
tempLabel.setFont(tChild.titleLabel.getFont());
int bdx = tempLabel.getX();
int bdy = tempLabel.getY();
bGraphics.translate(bdx, bdy);

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

txtTest1.setBounds(lblTest1.getX() + lblTest1.getWidth() + 5, insets.top + 5, txtTest1.getPreferredSize().width, txtTest1.getPreferredSize().height);
lblTest2.setBounds(txtTest1.getX() + txtTest1.getWidth() + 8, insets.top + 5, lblTest2.getPreferredSize().width, lblTest2.getPreferredSize().height);
txtTest2.setBounds(lblTest2.getX() + lblTest2.getWidth() + 8, insets.top + 5, txtTest2.getPreferredSize().width, txtTest2.getPreferredSize().height);
lblTest3.setBounds(txtTest2.getX() + txtTest2.getWidth() + 5, insets.top + 5, lblTest3.getPreferredSize().width, lblTest3.getPreferredSize().height);
txtTest3.setBounds(lblTest3.getX() + lblTest3.getWidth() + 5, insets.top + 5, txtTest3.getPreferredSize().width, txtTest3.getPreferredSize().height);
lblTest4.setBounds(txtTest3.getX() + txtTest3.getWidth() + 5, insets.top + 5, lblTest4.getPreferredSize().width, lblTest4.getPreferredSize().height);
txtTest4.setBounds(lblTest4.getX() + lblTest4.getWidth() + 5, insets.top + 5, txtTest4.getPreferredSize().width, txtTest4.getPreferredSize().height);
btnCalculate.setBounds(txtTest4.getX() + txtTest4.getWidth() + 5, insets.top + 5, btnCalculate.getPreferredSize().width, btnCalculate.getPreferredSize().height);
lblWeight1.setBounds(insets.left + 5, insets.top + 30, lblWeight1.getPreferredSize().width, lblWeight1.getPreferredSize().height);
txtWeight1.setBounds(lblWeight1.getX() + lblWeight1.getWidth() + 5, insets.top + 30, txtWeight1.getPreferredSize().width, txtWeight1.getPreferredSize().height);
lblWeight2.setBounds(txtWeight1.getX() + txtWeight1.getWidth() + 5, insets.top + 30, txtWeight1.getPreferredSize().width, txtWeight1.getPreferredSize().height);
txtWeight2.setBounds(lblWeight2.getX() + lblWeight2.getWidth() + 10, insets.top + 30, txtWeight2.getPreferredSize().width, txtWeight2.getPreferredSize().height);
lblWeight3.setBounds(txtWeight2.getX() + txtWeight2.getWidth() + 10, insets.top + 30, txtWeight2.getPreferredSize().width, txtWeight2.getPreferredSize().height);
txtWeight3.setBounds(lblWeight3.getX() + lblWeight3.getWidth() + 10, insets.top + 30, txtWeight3.getPreferredSize().width, txtWeight3.getPreferredSize().height);
lblWeight4.setBounds(txtWeight3.getX() + txtWeight3.getWidth() + 15, insets.top + 30, txtWeight4.getPreferredSize().width, txtWeight3.getPreferredSize().height);
txtWeight4.setBounds(lblWeight4.getX() + lblWeight4.getWidth() + 15, insets.top + 30, txtWeight4.getPreferredSize().width, txtWeight4.getPreferredSize().height);

相关文章

JLabel类方法