本文整理匯總了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);
}