本文整理汇总了Java中javax.swing.BorderFactory.createEtchedBorder方法的典型用法代码示例。如果您正苦于以下问题:Java BorderFactory.createEtchedBorder方法的具体用法?Java BorderFactory.createEtchedBorder怎么用?Java BorderFactory.createEtchedBorder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.BorderFactory
的用法示例。
在下文中一共展示了BorderFactory.createEtchedBorder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AutoHideStatusText
import javax.swing.BorderFactory; //导入方法依赖的package包/类
private AutoHideStatusText( JFrame frame, JPanel statusContainer ) {
this.statusContainer = statusContainer;
Border outerBorder = UIManager.getBorder( "Nb.ScrollPane.border" ); //NOI18N
if( null == outerBorder ) {
outerBorder = BorderFactory.createEtchedBorder();
}
panel.setBorder( BorderFactory.createCompoundBorder( outerBorder,
BorderFactory.createEmptyBorder(3,3,3,3) ) );
lblStatus.setName("AutoHideStatusTextLabel"); //NOI18N
panel.add( lblStatus, BorderLayout.CENTER );
frame.getLayeredPane().add( panel, Integer.valueOf( 101 ) );
StatusDisplayer.getDefault().addChangeListener( this );
frame.addComponentListener( new ComponentAdapter() {
@Override
public void componentResized( ComponentEvent e ) {
run();
}
});
}
示例2: createInstanceImpl
import javax.swing.BorderFactory; //导入方法依赖的package包/类
protected Border createInstanceImpl() {
if (highlight == null && shadow == null) {
return BorderFactory.createEtchedBorder(etchType);
} else {
return BorderFactory.createEtchedBorder(etchType,
highlight == null ? null : highlight.createInstance(),
shadow == null ? null : shadow.createInstance());
}
}
示例3: addTitledBorder
import javax.swing.BorderFactory; //导入方法依赖的package包/类
/**
* Adds a border and a title around a given component.
* If the component already has some border, it is overridden (not kept).
*
* @param component component the border and title should be added to
* @param insets insets between the component and the titled border
* @param title text of the title
*/
private static void addTitledBorder(JComponent component,
Insets insets,
String title) {
Border insideBorder = BorderFactory.createEmptyBorder(
insets.top, insets.left, insets.bottom, insets.right);
Border outsideBorder = new TitledBorder(
BorderFactory.createEtchedBorder(), title);
component.setBorder(new CompoundBorder(outsideBorder, insideBorder));
}
示例4: main
import javax.swing.BorderFactory; //导入方法依赖的package包/类
public static void main(String[] args) {
BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
BorderFactory.createEtchedBorder(EtchedBorder.RAISED, Color.BLACK, Color.WHITE);
BorderFactory.createEtchedBorder(EtchedBorder.LOWERED, Color.WHITE, Color.BLACK);
}