类javax.swing.plaf.metal.MetalButtonUI源码实例Demo

下面列出了怎么用javax.swing.plaf.metal.MetalButtonUI的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: iBioSim   文件: EditPreferences.java
private static JButton createColorButton(Color color) {
	JButton colorButton = new JButton();
	colorButton.setPreferredSize(new Dimension(30, 20));
	colorButton.setBorder(BorderFactory.createLineBorder(Color.darkGray));
	colorButton.setBackground(color);
	colorButton.setForeground(color);
	colorButton.setUI(new MetalButtonUI());
	//colorButton.setActionCommand("" + i);
	colorButton.addActionListener(new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent e) {
			//int i = Integer.parseInt(e.getActionCommand());
			Color newColor = JColorChooser.showDialog(Gui.frame, "Choose Color", ((JButton) e.getSource()).getBackground());
			if (newColor != null) {
				((JButton) e.getSource()).setBackground(newColor);
				((JButton) e.getSource()).setForeground(newColor);
			}
		}
	});
	return colorButton;
}
 
源代码2 项目: pushfish-android   文件: BorderlessImageButton.java
private void setUI() {
    // This fixes an issue where the WindowsButtonUI wants to draw a border
    // around a button that isn't in a toolbar.  This occurs even if you set
    // an empty border because it ignores your border and draws its own.
    setUI(MetalButtonUI.createUI(this));
}
 
private void setUI() {
    // This fixes an issue where the WindowsButtonUI wants to draw a border
    // around a button that isn't in a toolbar.  This occurs even if you set
    // an empty border because it ignores your border and draws its own.
    setUI(MetalButtonUI.createUI(this));
}
 
源代码4 项目: pushfish-android   文件: BorderlessImageButton.java
private void setUI() {
    // This fixes an issue where the WindowsButtonUI wants to draw a border
    // around a button that isn't in a toolbar.  This occurs even if you set
    // an empty border because it ignores your border and draws its own.
    setUI(MetalButtonUI.createUI(this));
}
 
private void setUI() {
    // This fixes an issue where the WindowsButtonUI wants to draw a border
    // around a button that isn't in a toolbar.  This occurs even if you set
    // an empty border because it ignores your border and draws its own.
    setUI(MetalButtonUI.createUI(this));
}
 
源代码6 项目: Pushjet-Android   文件: BorderlessImageButton.java
private void setUI() {
    // This fixes an issue where the WindowsButtonUI wants to draw a border
    // around a button that isn't in a toolbar.  This occurs even if you set
    // an empty border because it ignores your border and draws its own.
    setUI(MetalButtonUI.createUI(this));
}
 
private void setUI() {
    // This fixes an issue where the WindowsButtonUI wants to draw a border
    // around a button that isn't in a toolbar.  This occurs even if you set
    // an empty border because it ignores your border and draws its own.
    setUI(MetalButtonUI.createUI(this));
}
 
源代码8 项目: Pushjet-Android   文件: BorderlessImageButton.java
private void setUI() {
    // This fixes an issue where the WindowsButtonUI wants to draw a border
    // around a button that isn't in a toolbar.  This occurs even if you set
    // an empty border because it ignores your border and draws its own.
    setUI(MetalButtonUI.createUI(this));
}
 
private void setUI() {
    // This fixes an issue where the WindowsButtonUI wants to draw a border
    // around a button that isn't in a toolbar.  This occurs even if you set
    // an empty border because it ignores your border and draws its own.
    setUI(MetalButtonUI.createUI(this));
}
 
 类所在包
 类方法
 同包方法