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


Java AbstractButton.setBorderPainted方法代碼示例

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


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

示例1: removeButtonContentAreaAndBorder

import javax.swing.AbstractButton; //導入方法依賴的package包/類
private static void removeButtonContentAreaAndBorder(AbstractButton button) {
    boolean canRemove = true;
    if (button instanceof JToggleButton) {
        canRemove = !button.isSelected();
    }
    if (canRemove) {
        button.setContentAreaFilled(false);
        button.setBorderPainted(false);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:SearchButton.java

示例2: installUI

import javax.swing.AbstractButton; //導入方法依賴的package包/類
@Override
public void installUI(JComponent c) {
	super.installUI(c);
	c.setBorder(null);
	if (c instanceof AbstractButton) {
		AbstractButton btn = (AbstractButton) c;
		//btn.setMargin(new Insets(10,10,10,10));
		btn.setBorder(new EmptyBorder(5, 10, 5, 10));
		// btn.setIcon(new XDMBlankIcon(15, 10));
		btn.setBorderPainted(false);
		// btn.setMargin(new Insets(10, 10, 10, 10));
		// btn.setFont(new Font(Font.DIALOG, Font.PLAIN, 12));
	}
	// this.lightColor = Color.WHITE;
	// this.darkColor = new Color(230, 230, 230);
	// this.lightColor2 = new Color(245, 245, 245);
	// chkIcon = UIManager.getIcon("CheckBoxMenuItem.checkIcon");
}
 
開發者ID:kmarius,項目名稱:xdman,代碼行數:19,代碼來源:XDMMenuItemUI.java

示例3: mouseEntered

import javax.swing.AbstractButton; //導入方法依賴的package包/類
@Override
public void mouseEntered(MouseEvent evt) {
    Object src = evt.getSource();

    if (src instanceof AbstractButton) {
        AbstractButton button = (AbstractButton) evt.getSource();
        if (button.isEnabled()) {
            button.setContentAreaFilled(true);
            button.setBorderPainted(true);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:SearchButton.java

示例4: mouseEntered

import javax.swing.AbstractButton; //導入方法依賴的package包/類
public @Override void mouseEntered(MouseEvent evt) {
    Object src = evt.getSource();
    
    if (src instanceof AbstractButton) {
        AbstractButton button = (AbstractButton)evt.getSource();
        if (button.isEnabled()) {
            button.setContentAreaFilled(true);
            button.setBorderPainted(true);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:NbEditorToolBar.java

示例5: mouseExited

import javax.swing.AbstractButton; //導入方法依賴的package包/類
@Override
public void mouseExited(MouseEvent evt) {
    Object src = evt.getSource();
    if (src instanceof AbstractButton) {
        AbstractButton button = (AbstractButton) evt.getSource();
        button.setContentAreaFilled(false);
        button.setBorderPainted(false);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:DataViewUI.java

示例6: processButton

import javax.swing.AbstractButton; //導入方法依賴的package包/類
private void processButton(AbstractButton button) {
    button.setContentAreaFilled(false);
    button.setBorderPainted(false);
    button.setMargin(BUTTON_INSETS);
    if (button instanceof AbstractButton) {
        button.addMouseListener(sharedMouseListener);
    }
    //Focus shouldn't stay in toolbar
    button.setFocusable(false);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:11,代碼來源:DataViewUI.java

示例7: mouseEntered

import javax.swing.AbstractButton; //導入方法依賴的package包/類
@Override
public void mouseEntered(final MouseEvent e) {
	final Component c = e.getComponent();
	if (c instanceof AbstractButton) {
		final AbstractButton ab = (AbstractButton) c;
		ab.setBorderPainted(true);
	}
}
 
開發者ID:roscisz,項目名稱:KernelHive,代碼行數:9,代碼來源:JTabPanel.java

示例8: mouseExited

import javax.swing.AbstractButton; //導入方法依賴的package包/類
@Override
public void mouseExited(final MouseEvent e) {
	final Component c = e.getComponent();
	if (c instanceof AbstractButton) {
		final AbstractButton ab = (AbstractButton) c;
		ab.setBorderPainted(false);
	}
}
 
開發者ID:roscisz,項目名稱:KernelHive,代碼行數:9,代碼來源:JTabPanel.java

示例9: setLAF

import javax.swing.AbstractButton; //導入方法依賴的package包/類
/** Gives a button the Groove look-and-feel. */
static public void setLAF(final AbstractButton button) {
    button.setHideActionText(true);
    button.setFocusable(false);
    button.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(),
        BorderFactory.createEmptyBorder(3, 2, 3, 2)));
    button.setBorderPainted(button.isEnabled());
    button.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            button.setBorderPainted(button.isEnabled());
        }
    });
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:15,代碼來源:Options.java

示例10: mouseEntered

import javax.swing.AbstractButton; //導入方法依賴的package包/類
public void mouseEntered(MouseEvent e) {
    Component component = e.getComponent();
    if (component instanceof AbstractButton) {
        AbstractButton button = (AbstractButton) component;
        button.setBorderPainted(true);
    }
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:8,代碼來源:ButtonTabComponent.java

示例11: mouseExited

import javax.swing.AbstractButton; //導入方法依賴的package包/類
public void mouseExited(MouseEvent e) {
    Component component = e.getComponent();
    if (component instanceof AbstractButton) {
        AbstractButton button = (AbstractButton) component;
        button.setBorderPainted(false);
    }
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:8,代碼來源:ButtonTabComponent.java

示例12: mouseEntered

import javax.swing.AbstractButton; //導入方法依賴的package包/類
@Override
public void mouseEntered(MouseEvent e) {
    Component component = e.getComponent();
    if (component instanceof AbstractButton) {
        AbstractButton button = (AbstractButton) component;
        button.setBorderPainted(true);
    }
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:9,代碼來源:Tab.java

示例13: mouseExited

import javax.swing.AbstractButton; //導入方法依賴的package包/類
@Override
public void mouseExited(MouseEvent e) {
    Component component = e.getComponent();
    if (component instanceof AbstractButton) {
        AbstractButton button = (AbstractButton) component;
        button.setBorderPainted(false);
    }
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:9,代碼來源:Tab.java


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