本文整理匯總了Java中javax.swing.plaf.basic.BasicButtonUI類的典型用法代碼示例。如果您正苦於以下問題:Java BasicButtonUI類的具體用法?Java BasicButtonUI怎麽用?Java BasicButtonUI使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BasicButtonUI類屬於javax.swing.plaf.basic包,在下文中一共展示了BasicButtonUI類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: TabButton
import javax.swing.plaf.basic.BasicButtonUI; //導入依賴的package包/類
public TabButton() {
int size = 17;
setPreferredSize(new Dimension(size, size));
setToolTipText(LangTool.getString("popup.close"));
// Make the button looks the same for all Laf's
setUI(new BasicButtonUI());
// Make it transparent
setContentAreaFilled(false);
// No need to be focusable
setFocusable(false);
setBorder(BorderFactory.createEtchedBorder());
setBorderPainted(false);
// Making nice rollover effect
// we use the same listener for all buttons
addMouseListener(buttonMouseListener);
setRolloverEnabled(true);
// Close the proper tab by clicking the button
addActionListener(this);
}
示例2: TabButton
import javax.swing.plaf.basic.BasicButtonUI; //導入依賴的package包/類
public TabButton() {
int size = 17;
setPreferredSize(new Dimension(size, size));
setToolTipText("close this tab");
// Make the button looks the same for all Laf's
setUI(new BasicButtonUI());
// Make it transparent
setContentAreaFilled(false);
// No need to be focusable
setFocusable(false);
setBorder(BorderFactory.createEtchedBorder());
setBorderPainted(false);
// Making nice rollover effect
// we use the same listener for all buttons
addMouseListener(buttonMouseListener);
setRolloverEnabled(true);
// Close the proper tab by clicking the button
addActionListener(this);
}
示例3: TabButton
import javax.swing.plaf.basic.BasicButtonUI; //導入依賴的package包/類
public TabButton() {
int size = 17;
setPreferredSize(new Dimension(size, size));
setToolTipText("close this tab");
//Make the button looks the same for all Laf's
setUI(new BasicButtonUI());
//Make it transparent
setContentAreaFilled(false);
//No need to be focusable
setFocusable(false);
setBorder(BorderFactory.createEtchedBorder());
setBorderPainted(false);
//Making nice rollover effect
//we use the same listener for all buttons
addMouseListener(buttonMouseListener);
setRolloverEnabled(true);
//Close the proper tab by clicking the button
addActionListener(this);
}
示例4: TabButton
import javax.swing.plaf.basic.BasicButtonUI; //導入依賴的package包/類
public TabButton() {
// super(SmartIcons.close);
int size = 16;
setPreferredSize(new Dimension(size, size));
setToolTipText("close");
//Make the button looks the same for all Laf's
setUI(new BasicButtonUI());
setOpaque(false);
//Make it transparent
setContentAreaFilled(false);
//No need to be focusable
setFocusable(false);
setBorder(BorderFactory.createEmptyBorder());
setBorderPainted(false);
//Making nice rollover effect
//we use the same listener for all buttons
// addMouseListener(buttonMouseListener);
setRolloverEnabled(true);
//Close the proper tab by clicking the button
addActionListener(this);
}
示例5: TabButton
import javax.swing.plaf.basic.BasicButtonUI; //導入依賴的package包/類
public TabButton() {
int size = 17;
setPreferredSize(new Dimension(size, size));
setToolTipText(TabLabel.this.kind.getName());
//Make the button looks the same for all Laf's
setUI(new BasicButtonUI());
//Make it transparent
setContentAreaFilled(false);
//No need to be focusable
setFocusable(false);
setBorder(BorderFactory.createEtchedBorder());
setBorderPainted(false);
//Making nice rollover effect
//we use the same listener for all buttons
addMouseListener(buttonMouseListener);
setRolloverEnabled(true);
//Close the proper tab by clicking the button
addActionListener(this);
if (TabLabel.this.kind != Kind.RESOURCE && TabLabel.this.kind != Kind.LIST) {
setIcon(Icons.PIN_ICON);
}
}
示例6: TabButton
import javax.swing.plaf.basic.BasicButtonUI; //導入依賴的package包/類
public TabButton() {
int size = 17;
setPreferredSize(new Dimension(size, size));
//setToolTipText("close this tab");
//Make the button looks the same for all Laf's
setUI(new BasicButtonUI());
//Make it transparent
setContentAreaFilled(false);
//No need to be focusable
setFocusable(false);
setBorder(BorderFactory.createEtchedBorder());
setBorderPainted(false);
//Making nice rollover effect
//we use the same listener for all buttons
addMouseListener(buttonMouseListener);
setRolloverEnabled(true);
//Close the proper tab by clicking the button
addActionListener(this);
}
示例7: TabButton
import javax.swing.plaf.basic.BasicButtonUI; //導入依賴的package包/類
public TabButton ()
{
final int size = 13; // Button side length
setPreferredSize(new Dimension(size, size));
setToolTipText("close this tab");
//Make the button looks the same for all Laf's
setUI(new BasicButtonUI());
//Make it transparent
setContentAreaFilled(false);
//No need to be focusable
setFocusable(false);
setBorder(BorderFactory.createEtchedBorder());
setBorderPainted(false);
//Making nice rollover effect
//we use the same listener for all buttons
addMouseListener(buttonMouseListener);
setRolloverEnabled(true);
//Close the proper tab by clicking the button
addActionListener(this);
}
示例8: CustomButton
import javax.swing.plaf.basic.BasicButtonUI; //導入依賴的package包/類
public CustomButton(String toolTip) {
setToolTipText(toolTip);
//Make the button looks the same for all Laf's
setUI(new BasicButtonUI());
//Make it transparent
setContentAreaFilled(false);
//No need to be focusable
setFocusable(false);
setBorder(BorderFactory.createEtchedBorder());
setBorderPainted(false);
//Making nice rollover effect
//we use the same listener for all buttons
addMouseListener(buttonMouseListener);
setRolloverEnabled(true);
}
示例9: TabButton
import javax.swing.plaf.basic.BasicButtonUI; //導入依賴的package包/類
public TabButton() {
int size = 17;
setPreferredSize(new Dimension(size, size));
setToolTipText("Hide this Tab");
//Make the button looks the same for all Laf's
setUI(new BasicButtonUI());
//Make it transparent
setContentAreaFilled(false);
//No need to be focusable
setFocusable(false);
setBorder(BorderFactory.createEtchedBorder());
setBorderPainted(false);
//Making nice rollover effect
//we use the same listener for all buttons
addMouseListener(buttonMouseListener);
setRolloverEnabled(true);
//Close the proper tab by clicking the button
addActionListener(this);
}
示例10: TabButton
import javax.swing.plaf.basic.BasicButtonUI; //導入依賴的package包/類
/**
* Default constructor.
*/
public TabButton() {
super(new ImageIcon(GeOxygeneApplication.class.getResource(
"/images/icons/16x16/delete.png").getPath()));
this.setToolTipText("close this tab");
// Make the button looks the same for all Laf's
this.setUI(new BasicButtonUI());
// Make it transparent
this.setContentAreaFilled(false);
// No need to be focusable
this.setFocusable(false);
this.setBorder(BorderFactory.createEtchedBorder());
this.setBorderPainted(false);
// Making nice rollover effect
// we use the same listener for all buttons
this.addMouseListener(buttonMouseListener);
this.setRolloverEnabled(true);
// Close the proper tab by clicking the button
this.addActionListener(this);
}
示例11: ButtonClose
import javax.swing.plaf.basic.BasicButtonUI; //導入依賴的package包/類
public ButtonClose(JTabbedPane pane, TabWithCloseButton buttonClose) {
panel = pane;
this.buttonClose = buttonClose;
int size = 17;
setPreferredSize(new Dimension(size, size));
setToolTipText(Bundle.TabWithCloseButton_ToolTipCloseTab());
setUI(new BasicButtonUI());
setContentAreaFilled(false);
setFocusable(false);
setBorder(BorderFactory.createEtchedBorder());
setBorderPainted(false);
addMouseListener(this);
setRolloverEnabled(true);
addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
int index = panel.indexOfTabComponent(ButtonClose.this.buttonClose);
if (index != -1) {
TestResultTopComponent.closeTab(index);
}
}
});
}
示例12: TabButton
import javax.swing.plaf.basic.BasicButtonUI; //導入依賴的package包/類
public TabButton() {
int size = 17;
setPreferredSize(new Dimension(size, size));
setToolTipText(messages.getMainMessage("closeTabToolTip"));
//Make the button looks the same for all Laf's
setUI(new BasicButtonUI());
//Make it transparent
setContentAreaFilled(false);
//No need to be focusable
setFocusable(false);
setBorder(BorderFactory.createEtchedBorder());
setBorderPainted(false);
//Making nice rollover effect
//we use the same listener for all buttons
addMouseListener(buttonMouseListener);
addAncestorListener(ancestorListener);
setRolloverEnabled(true);
//Close the proper tab by clicking the button
addActionListener(this);
}
示例13: customizeCheckBox
import javax.swing.plaf.basic.BasicButtonUI; //導入依賴的package包/類
private void customizeCheckBox(final JCheckBox checkBox) {
Font robotoPlain13 = new Font("Roboto", 0, 13);
checkBox.setUI(new BasicButtonUI() {
@Override
protected void paintText(Graphics g, AbstractButton b, Rectangle textRect, String text) {
textRect.translate(28, 0);
super.paintText(g, b, textRect, text);
}
});
checkBox.setFont(robotoPlain13);
checkBox.setForeground(checkBox.isSelected()? FOREGROUND_COLOR_SELECTED : FOREGROUND_COLOR);
checkBox.setOpaque(false);
checkBox.setIcon(new ImageIcon(MapOptionsExample.class.getResource("res/checkbox_0.png")));
checkBox.setSelectedIcon(new ImageIcon(MapOptionsExample.class.getResource("res/checkbox_1.png")));
checkBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkBox.setForeground(checkBox.isSelected()? FOREGROUND_COLOR_SELECTED : FOREGROUND_COLOR);
}
});
}
示例14: TabButton
import javax.swing.plaf.basic.BasicButtonUI; //導入依賴的package包/類
public TabButton() {
int size = 17;
setPreferredSize(new Dimension(size, size));
setToolTipText("close this tab");
//Make the button looks the same for all Laf's
setUI(new BasicButtonUI());
//Make it transparent
setContentAreaFilled(false);
//No need to be focusable
setFocusable(false);
setBorder(BorderFactory.createEtchedBorder());
setBorderPainted(false);
//Making nice rollover effect
//we use the same listener for all buttons
addMouseListener(buttonMouseListener);
setRolloverEnabled(true);
//Close the proper tab by clicking the button
addActionListener(this);
}
示例15: TabButton
import javax.swing.plaf.basic.BasicButtonUI; //導入依賴的package包/類
/**
* Creates a new tab button object.
*/
public TabButton() {
final int size = 17;
setPreferredSize(new Dimension(size, size));
setToolTipText("Close this tab.");
// Make the button look the same for all Laf's
setUI(new BasicButtonUI());
// Make it transparent
setContentAreaFilled(false);
// No need to be focusable
setFocusable(false);
setBorder(BorderFactory.createBevelBorder(1)); // createEtchedBorder());
setBorderPainted(false);
// Making nice rollover effect
// we use the same listener for all buttons
addMouseListener(buttonMouseListener);
setRolloverEnabled(true);
// Close the proper tab by clicking the button
addActionListener(this);
}