本文整理了Java中javax.swing.AbstractButton.getComponentCount()
方法的一些代码示例,展示了AbstractButton.getComponentCount()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractButton.getComponentCount()
方法的具体详情如下:
包路径:javax.swing.AbstractButton
类名称:AbstractButton
方法名:getComponentCount
暂无
代码示例来源:origin: com.jidesoft/jide-oss
public static Dimension getPreferredButtonSize(AbstractButton b, int textIconGap, boolean isHorizontal) {
if (b.getComponentCount() > 0) {
return null;
}
Icon icon = b.getIcon();
String text = b.getText();
Font font = b.getFont();
FontMetrics fm = b.getFontMetrics(font);
Rectangle iconR = new Rectangle();
Rectangle textR = new Rectangle();
Rectangle viewR = new Rectangle(Short.MAX_VALUE, Short.MAX_VALUE);
layoutCompoundLabel(b, fm, text, icon, isHorizontal,
b.getVerticalAlignment(), b.getHorizontalAlignment(),
b.getVerticalTextPosition(), b.getHorizontalTextPosition(),
viewR, iconR, textR, (text == null ? 0 : textIconGap));
/* The preferred size of the button is the size of
* the text and icon rectangles plus the buttons insets.
*/
Rectangle r = iconR.union(textR);
Insets insets = b.getInsets();
r.width += insets.left + insets.right;
r.height += insets.top + insets.bottom;
return r.getSize();
}
代码示例来源:origin: org.swinglabs.swingx/swingx-core
if (b.getComponentCount() > 0) {
return null;
代码示例来源:origin: com.haulmont.thirdparty/swingx-core
if (b.getComponentCount() > 0) {
return null;
代码示例来源:origin: org.swinglabs.swingx/swingx-all
if (b.getComponentCount() > 0) {
return null;
代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core
if (b.getComponentCount() > 0) {
return null;
代码示例来源:origin: org.codehaus.jtstand/jtstand-desktop
if (b.getComponentCount() > 0) {
return null;
内容来源于网络,如有侵权,请联系作者删除!