當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。