当前位置: 首页>>代码示例>>Java>>正文


Java JLayeredPane.setLayout方法代码示例

本文整理汇总了Java中javax.swing.JLayeredPane.setLayout方法的典型用法代码示例。如果您正苦于以下问题:Java JLayeredPane.setLayout方法的具体用法?Java JLayeredPane.setLayout怎么用?Java JLayeredPane.setLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JLayeredPane的用法示例。


在下文中一共展示了JLayeredPane.setLayout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DesktopImpl

import javax.swing.JLayeredPane; //导入方法依赖的package包/类
/** Creates a new instance of DesktopImpl */
public DesktopImpl () {
    // layered pane with absolute positioning, to enable overlapping
    layeredPane = new JLayeredPane();
    layeredPane.setLayout(new LayeredLayout());
    // desktop represents regular layer of layeredPane
    desktop = new JPanel() {
        @Override
        public boolean isOpaque() {
            if( UIManager.getBoolean( "NbMainWindow.showCustomBackground" ) ) //NOI18N
                return false;
            return super.isOpaque();
        }

        @Override
        public void updateUI() {
            Mutex.EVENT.readAccess( new Runnable() {
                @Override
                public void run() {
                    superUpdateUI();
                }
            });
        }

        private void superUpdateUI() {
            super.updateUI();
        }
    };
    desktop.setLayout(new GridBagLayout());
    Color bkColor = UIManager.getColor("NbSplitPane.background"); //NOI18N
    if( null != bkColor ) {
        desktop.setBackground(bkColor);
        desktop.setOpaque(true);
    }
    layeredPane.add(desktop);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:DesktopImpl.java

示例2: makePreviewTable

import javax.swing.JLayeredPane; //导入方法依赖的package包/类
/**
 * Fills the tablePane with content.
 */
private JComponent makePreviewTable() {
	previewTable = new ExtendedJTable(false, false, false);
	// ensure same background as JPanels in case of only few rows
	previewTable.setBackground(Colors.PANEL_BACKGROUND);
	previewTable.setColoredTableCellRenderer(new ColoredTableCellRenderer() {

		private final Font boldFont = getFont().deriveFont(Font.BOLD);

		@Override
		public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
				int row, int column) {
			JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
			adjustCell(row, label, boldFont);
			return label;
		}

	});

	loadingContentPane = new LoadingContentPane("loading_data", previewTable);

	tablePane = new JScrollPane(loadingContentPane);
	tablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
	tablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	tablePane.setBorder(null);

	// add PREVIEW label in front of scrollpane
	JLayeredPane layeredPane = new JLayeredPane();
	layeredPane.setLayout(new OverlayLayout(layeredPane));
	layeredPane.add(tablePane, JLayeredPane.DEFAULT_LAYER);

	JPanel overlayPanel = new JPanel(new BorderLayout());
	overlayPanel.setOpaque(false);
	overlayLabel = new JLabel("", SwingConstants.CENTER);
	showPreviewLettering();
	overlayPanel.add(overlayLabel, BorderLayout.CENTER);

	layeredPane.add(overlayPanel, JLayeredPane.PALETTE_LAYER);
	return layeredPane;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:43,代码来源:CSVFormatSpecificationPanel.java


注:本文中的javax.swing.JLayeredPane.setLayout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。