本文整理了Java中javax.swing.JLabel.contains()
方法的一些代码示例,展示了JLabel.contains()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JLabel.contains()
方法的具体详情如下:
包路径:javax.swing.JLabel
类名称:JLabel
方法名:contains
暂无
代码示例来源:origin: org.codehaus.jtstand/jtstand-ui
private void maybeShowPopup(MouseEvent e) {
if (e.isPopupTrigger() && jLabel.isEnabled()) {
Point p = new Point(e.getX(), e.getY());
if (jLabel.contains(p)) {
/* create popup menu... */
JPopupMenu contextMenu = createLoginContextMenu(jLabel);
/* ... and show it */
if (contextMenu != null && contextMenu.getComponentCount() > 0) {
contextMenu.show(jLabel, p.x, p.y);
}
}
}
}
代码示例来源:origin: com.samskivert/samskivert
public void mouseReleased (MouseEvent e)
{
// if the mouse was released within the bounds of the button, go
// ahead and select it properly
if (_selectedButton != null) {
if (_selectedButton.contains(e.getX(), e.getY())) {
// tell the model that the selection has changed (and
// we'll respond and do our business
Object elem = _selectedButton.getClientProperty("element");
_model.setSelectedItem(elem);
} else {
_selectedButton.setBorder(DESELECTED_BORDER);
_selectedButton.repaint();
}
// clear out the selected button indicator
_selectedButton = null;
}
}
代码示例来源:origin: stackoverflow.com
b.repaint();
if (b.contains(e.getPoint()))
内容来源于网络,如有侵权,请联系作者删除!