本文整理汇总了Java中javax.swing.border.CompoundBorder.getBorderInsets方法的典型用法代码示例。如果您正苦于以下问题:Java CompoundBorder.getBorderInsets方法的具体用法?Java CompoundBorder.getBorderInsets怎么用?Java CompoundBorder.getBorderInsets使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.border.CompoundBorder
的用法示例。
在下文中一共展示了CompoundBorder.getBorderInsets方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getJTopPanel
import javax.swing.border.CompoundBorder; //导入方法依赖的package包/类
/**
* This method initializes jTopPanel
*
* @return javax.swing.JPanel
*/
private JPanel getJTopPanel() {
if (jTopPanel == null) {
jTopPanel = new JPanel();
CompoundBorder border = BorderFactory.createCompoundBorder(
BorderFactory.createCompoundBorder(
BorderFactory.createLineBorder(SystemColor.activeCaption,2),
JPlagCreator.titleBorder(Messages.getString(
"InfoPanel.JPlag_progress"))), //$NON-NLS-1$
BorderFactory.createEmptyBorder(0,2,2,2));
jTopPanel.setBorder(border);
Insets insets = border.getBorderInsets(jTopPanel);
jTopPanel.setPreferredSize(
new java.awt.Dimension(490+insets.left+insets.right, 194));
jTopPanel.setLayout(new BorderLayout());
jTopPanel.add(getJPanel2(), java.awt.BorderLayout.NORTH);
jTopPanel.add(getJProgressBar(), java.awt.BorderLayout.EAST);
}
return jTopPanel;
}
示例2: JIconTextField
import javax.swing.border.CompoundBorder; //导入方法依赖的package包/类
public JIconTextField(){
super();
this.icon = null;
/*
Border border = UIManager.getBorder("TextField.border");
this.dummyInsets = border.getBorderInsets(dummy);
*/
JTextField dummy = new JTextField();
Border line = BorderFactory.createLineBorder(Color.lightGray);
Border empty = new EmptyBorder(6,26,5,5);
CompoundBorder border = new CompoundBorder(line, empty);
this.dummyInsets = border.getBorderInsets(dummy);
this.setBorder(border);
}