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


Java JScrollPane.setCorner方法代碼示例

本文整理匯總了Java中javax.swing.JScrollPane.setCorner方法的典型用法代碼示例。如果您正苦於以下問題:Java JScrollPane.setCorner方法的具體用法?Java JScrollPane.setCorner怎麽用?Java JScrollPane.setCorner使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JScrollPane的用法示例。


在下文中一共展示了JScrollPane.setCorner方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: installLabels

import javax.swing.JScrollPane; //導入方法依賴的package包/類
private void installLabels(JScrollPane scrollPane) {
	moreColumnsLabel.setIcon(JMTImageLoader.loadImage("table_rightarrow"));
	moreColumnsLabel.setHorizontalAlignment(SwingConstants.CENTER);
	moreColumnsLabel.setToolTipText(moreColumnsTooltip);
	moreColumnsLabel.setVisible(false);

	moreRowsLabel.setIcon(JMTImageLoader.loadImage("table_downarrow"));
	moreRowsLabel.setHorizontalAlignment(SwingConstants.CENTER);
	moreRowsLabel.setToolTipText(moreRowsTooltip);
	moreRowsLabel.setVisible(false);

	scrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, moreColumnsLabel);
	scrollPane.setCorner(ScrollPaneConstants.LOWER_LEFT_CORNER, moreRowsLabel);

	if (displaysScrollLabels) {
		updateScrollLabels();
	}
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:19,代碼來源:ExactTable.java

示例2: installLabels

import javax.swing.JScrollPane; //導入方法依賴的package包/類
private void installLabels(JScrollPane scrollPane) {
	moreColumnsLabel.setIcon(JMTImageLoader.loadImage("table_rightarrow"));
	moreColumnsLabel.setHorizontalAlignment(SwingConstants.CENTER);
	moreColumnsLabel.setToolTipText(moreColumnsTooltip);
	moreColumnsLabel.setVisible(false);

	moreRowsLabel.setIcon(JMTImageLoader.loadImage("table_downarrow"));
	moreRowsLabel.setHorizontalAlignment(SwingConstants.CENTER);
	moreRowsLabel.setToolTipText(moreRowsTooltip);
	moreRowsLabel.setVisible(false);

	scrollPane.setCorner(ScrollPaneConstants.UPPER_RIGHT_CORNER, moreColumnsLabel);
	scrollPane.setCorner(ScrollPaneConstants.LOWER_LEFT_CORNER, moreRowsLabel);

	if (displaysScrollLabels) {
		updateScrollLabels();
	}

}
 
開發者ID:HOMlab,項目名稱:QN-ACTR-Release,代碼行數:20,代碼來源:ExactTable.java

示例3: installSelectAllButton

import javax.swing.JScrollPane; //導入方法依賴的package包/類
private void installSelectAllButton(JScrollPane scrollPane) {
	selectAllButton.setFocusable(false);
	selectAllButton.setBorder(UIManager.getBorder("TableHeader.cellBorder"));
	scrollPane.setCorner(ScrollPaneConstants.UPPER_LEFT_CORNER, selectAllButton);
}
 
開發者ID:max6cn,項目名稱:jmt,代碼行數:6,代碼來源:ExactTable.java

示例4: initGlyphCorner

import javax.swing.JScrollPane; //導入方法依賴的package包/類
protected void initGlyphCorner(JScrollPane scroller){
    glyphCorner = new JPanel();
    updateScrollPaneCornerColor();
    scroller.setCorner(JScrollPane.LOWER_LEFT_CORNER, glyphCorner);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:EditorUI.java

示例5: initComponents

import javax.swing.JScrollPane; //導入方法依賴的package包/類
private void initComponents() {        
    table = new DetailsTable();
    table.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    JViewport viewport = new Viewport(table);

    final JScrollPane tableScroll = new JScrollPane(
                                        JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                                        JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    tableScroll.setViewport(viewport);
    tableScroll.setBorder(BorderFactory.createEmptyBorder());
    tableScroll.setViewportBorder(BorderFactory.createEmptyBorder());
    tableScroll.setCorner(JScrollPane.UPPER_RIGHT_CORNER, new HeaderPanel());
    
    scrollBar = new ScrollBar(JScrollBar.VERTICAL) {
        public int getUnitIncrement(int direction) {
            JViewport vp = tableScroll.getViewport();
            Scrollable view = (Scrollable)(vp.getView());
            Rectangle vr = vp.getViewRect();
            return view.getScrollableUnitIncrement(vr, getOrientation(), direction);
        }
        public int getBlockIncrement(int direction) {
            JViewport vp = tableScroll.getViewport();
            Scrollable view = (Scrollable)(vp.getView());
            Rectangle vr = vp.getViewRect();
            return view.getScrollableBlockIncrement(vr, getOrientation(), direction);
        }
        public void setValues(int newValue, int newExtent, int newMin, int newMax) {
            setEnabled(newExtent < newMax);
            if (isEnabled() && !isSelectionChanging() && isTrackingEnd())
                newValue = newMax - newExtent;
            super.setValues(newValue, newExtent, newMin, newMax);
        }
    };
    tableScroll.setVerticalScrollBar(scrollBar);
    dataContainer = tableScroll;

    JLabel noDataLabel = new JLabel("<No probe selected>", JLabel.CENTER);
    noDataLabel.setEnabled(false);
    noDataContainer = new JPanel(new BorderLayout());
    noDataContainer.setOpaque(false);
    noDataContainer.add(noDataLabel, BorderLayout.CENTER);

    setOpaque(false);
    setLayout(new BorderLayout());
    add(noDataContainer, BorderLayout.CENTER);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:48,代碼來源:DetailsPanel.java

示例6: AutoCompletePopupWindow

import javax.swing.JScrollPane; //導入方法依賴的package包/類
/**
 * Constructor.
 *
 * @param parent The parent window (hosting the text component).
 * @param ac The auto-completion instance.
 */
public AutoCompletePopupWindow(Window parent, final AutoCompletion ac) {

	super(parent);
	ComponentOrientation o = ac.getTextComponentOrientation();

	this.ac = ac;
	model = new CompletionListModel();
	list = new PopupList(model);

	list.setCellRenderer(new DelegatingCellRenderer());
	list.addListSelectionListener(this);
	list.addMouseListener(this);

	JPanel contentPane = new JPanel(new BorderLayout());
	JScrollPane sp = new JScrollPane(list,
						JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
						JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);

	// In 1.4, JScrollPane.setCorner() has a bug where it won't accept
	// JScrollPane.LOWER_TRAILING_CORNER, even though that constant is
	// defined.  So we have to put the logic added in 1.5 to handle it
	// here.
	JPanel corner = new SizeGrip();
	//sp.setCorner(JScrollPane.LOWER_TRAILING_CORNER, corner);
	boolean isLeftToRight = o.isLeftToRight();
    String str = isLeftToRight ? JScrollPane.LOWER_RIGHT_CORNER :
    								JScrollPane.LOWER_LEFT_CORNER;
    sp.setCorner(str, corner);

	contentPane.add(sp);
	setContentPane(contentPane);
	applyComponentOrientation(o);

	// Give apps a chance to decorate us with drop shadows, etc.
	if (Util.getShouldAllowDecoratingMainAutoCompleteWindows()) {
		PopupWindowDecorator decorator = PopupWindowDecorator.get();
		if (decorator!=null) {
			decorator.decorate(this);
		}
	}

	pack();

	setFocusableWindowState(false);

	lastLine = -1;

}
 
開發者ID:Thecarisma,項目名稱:powertext,代碼行數:55,代碼來源:AutoCompletePopupWindow.java


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