本文整理汇总了Java中javax.swing.border.AbstractBorder.getBorderInsets方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractBorder.getBorderInsets方法的具体用法?Java AbstractBorder.getBorderInsets怎么用?Java AbstractBorder.getBorderInsets使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.border.AbstractBorder
的用法示例。
在下文中一共展示了AbstractBorder.getBorderInsets方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: test
import javax.swing.border.AbstractBorder; //导入方法依赖的package包/类
private static void test(AbstractBorder border) {
Insets insets = new Insets(0, 0, 0, 0);
if (insets != border.getBorderInsets(getComponent(border), insets)) {
throw new Error("both instances are differ for " + border.getClass());
}
test(border, insets);
}
示例2: checkInsets
import javax.swing.border.AbstractBorder; //导入方法依赖的package包/类
private void checkInsets(final AbstractBorder border, final Insets testInsets) {
assertEquals(testInsets, border.getBorderInsets(newJComponent()));
assertFalse(border.isBorderOpaque());
Insets insets = new Insets(0, 0, 0, 0);
border.getBorderInsets(newJComponent(), insets);
assertEquals(border.getBorderInsets(newJComponent()), insets);
JComponent button = newJComponent();
assertFalse(border.getBorderInsets(button) == border.getBorderInsets(button));
}
示例3: checkInsets
import javax.swing.border.AbstractBorder; //导入方法依赖的package包/类
private void checkInsets(final AbstractBorder border, final JComponent c) {
Insets ins = new Insets(100, 100, 100, 100);
border.getBorderInsets(c, ins);
assertEquals(border.getBorderInsets(c), ins);
}