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