當前位置: 首頁>>代碼示例>>Java>>正文


Java BorderFactory.createEtchedBorder方法代碼示例

本文整理匯總了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();
        }
    });
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:21,代碼來源:AutoHideStatusText.java

示例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());
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:BorderBuilders.java

示例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));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:JavaTestCreatorConfiguration.java

示例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);
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:7,代碼來源:Test4120351.java


注:本文中的javax.swing.BorderFactory.createEtchedBorder方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。