当前位置: 首页>>代码示例>>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;未经允许,请勿转载。