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


Java BasicButtonUI類代碼示例

本文整理匯總了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);
}
 
開發者ID:tn5250j,項目名稱:tn5250j,代碼行數:20,代碼來源:ButtonTabComponent.java

示例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);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:20,代碼來源:ButtonTabComponent.java

示例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);
}
 
開發者ID:ksaluja24,項目名稱:scratch-bench,代碼行數:20,代碼來源:ButtonTabComponent.java

示例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);
}
 
開發者ID:Jamling,項目名稱:SmartQQ4IntelliJ,代碼行數:22,代碼來源:ClosableTabHost.java

示例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);
    }
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:23,代碼來源:TabLabel.java

示例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);
}
 
開發者ID:BlidiWajdi,項目名稱:Mujeed-Arabic-Prolog,代碼行數:20,代碼來源:ButtonTabComponent.java

示例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);
}
 
開發者ID:Audiveris,項目名稱:audiveris,代碼行數:26,代碼來源:ButtonTabComponent.java

示例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);

}
 
開發者ID:denkbar,項目名稱:djigger,代碼行數:17,代碼來源:CustomButton.java

示例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);
}
 
開發者ID:openea,項目名稱:eva2,代碼行數:20,代碼來源:TabbedFrameMaker.java

示例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);
}
 
開發者ID:IGNF,項目名稱:geoxygene,代碼行數:23,代碼來源:AbstractMainFrame.java

示例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);
            }
        }
    });
}
 
開發者ID:fundacionjala,項目名稱:oblivion-netbeans-plugin,代碼行數:24,代碼來源:TabWithCloseButton.java

示例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);
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:22,代碼來源:ButtonTabComponent.java

示例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);
        }
    });
}
 
開發者ID:TeamDev-Ltd,項目名稱:JxMaps-Examples,代碼行數:22,代碼來源:MapOptionsExample.java

示例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);
        }
 
開發者ID:iig-uni-freiburg,項目名稱:SWAT20,代碼行數:20,代碼來源:SwatTabView.java

示例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);
}
 
開發者ID:google,項目名稱:binnavi,代碼行數:23,代碼來源:ButtonTabComponent.java


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