类javax.swing.plaf.basic.BasicButtonUI源码实例Demo

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

源代码1 项目: CQL   文件: ButtonTabComponent.java
private 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);
}
 
源代码2 项目: MeteoInfo   文件: ButtonTabComponent.java
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 项目: marathonv5   文件: ButtonTabComponent.java
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 项目: SmartIM4IntelliJ   文件: ClosableTabHost.java
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 项目: SmartIM   文件: ClosableTabHost.java
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);
}
 
源代码6 项目: ramus   文件: ButtonTabComponent.java
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 项目: audiveris   文件: ButtonTabComponent.java
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 项目: java-disassembler   文件: TabbedPane.java
public TabButton() {
    final 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);
}
 
源代码9 项目: JavaSerialKiller   文件: ButtonTabComponent.java
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);
}
 
源代码10 项目: cuba   文件: ButtonTabComponent.java
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);
}
 
源代码11 项目: binnavi   文件: ButtonTabComponent.java
/**
 * 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);
}
 
源代码12 项目: KEEL   文件: ButtonTabComponent.java
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);
}
 
源代码13 项目: javamelody   文件: MButtonTabComponent.java
/**
 * Constructor.
 */
TabButton() {
	super();
	final 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(BUTTON_MOUSE_LISTENER);
	setRolloverEnabled(true);
	//Close the proper tab by clicking the button
	addActionListener(this);
}
 
源代码14 项目: JCEditor   文件: ButtonTabComponent.java
public TabButton() {
    int size = 17;
    setPreferredSize(new Dimension(size, size));
    setToolTipText("Fechar aba");
    //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 项目: tn5250j   文件: ButtonTabComponent.java
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);
}
 
源代码16 项目: tn5250j   文件: ButtonTabComponent.java
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);
}
 
源代码17 项目: LoboBrowser   文件: PermissionCellButton.java
public PermissionCellButton(final PermissionSystem.PermissionBoard.PermissionRow.PermissionCell cell, final String text, final boolean alignRight, final ChangeListener changeListener) {
  super(text);
  this.cell = cell;
  this.canBeUndecidable = cell.canBeUndecidable;
  this.cellChangeListener = changeListener;

  // final Border defaultBorder = getBorder();
  final Insets marginInsets = getMargin();
  final Insets borderInsets = grow(marginInsets, BORDER_PADDING);
  final Border emptyBorder =
      BorderFactory
          .createEmptyBorder(borderInsets.top, borderInsets.left, borderInsets.bottom, borderInsets.right);
  final Border defaultColorBorder = BorderFactory.createDashedBorder(GREY_TRANSPARENT);
  final CompoundBorder plainBorder = BorderFactory.createCompoundBorder(defaultColorBorder, emptyBorder);
  setBorder(plainBorder);

  permissionResult = cell.getEffectivePermission();
  assert (permissionResult.permission.isDecided());

  setHorizontalAlignment(alignRight ? SwingConstants.RIGHT : SwingConstants.CENTER);
  setUI(new BasicButtonUI());
  addMouseMotionListener(this);
  setFocusable(false);
  setForeground(Color.BLACK);
  updateBackground();
}
 
源代码18 项目: xtunnel   文件: ButtonTabComponent.java
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);
}
 
源代码19 项目: wildfly-core   文件: ButtonTabComponent.java
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);
}
 
源代码20 项目: bytecode-viewer   文件: TabbedPane.java
public TabButton() {
    final 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);
}
 
源代码21 项目: pumpernickel   文件: JSwitchButton.java
@Override
public void updateUI() {
	if (UIManager.getDefaults().get(uiClassID) == null) {
		UIManager.getDefaults().put(uiClassID,
				"com.pump.plaf.button.SwitchButtonUI");
	}
	BasicButtonUI sui = (BasicButtonUI) UIManager.getUI(this);
	super.setUI(sui);
}
 
源代码22 项目: bigtable-sql   文件: SmallTabButton.java
public SmallTabButton(String toolTipText, ImageIcon icon, T userObject)
{
   _icon = icon;
   _userObject = userObject;
   int size;
   if (null == icon)
   {
      size = 17;
   }
   else
   {
      size = Math.max(_icon.getIconWidth(), _icon.getIconHeight()) + 5;
   }
   setPreferredSize(new Dimension(size, size));
   setToolTipText(toolTipText);

   //setIcon(icon);
   //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(s_buttonMouseListener);
   setRolloverEnabled(true);
   //Close the proper tab by clicking the button
   //addActionListener(this);
   setOpaque(false);
}
 
源代码23 项目: wpcleaner   文件: CloseTabComponent.java
public TabButton() {
  int size = 17;
  setPreferredSize(new Dimension(size, size));
  setToolTipText(GT._T("Close this tab"));
  setUI(new BasicButtonUI());
  setContentAreaFilled(false);
  setFocusable(false);
  setBorder(BorderFactory.createEtchedBorder());
  setBorderPainted(false);
  addMouseListener(closeMouseListener);
  setRolloverEnabled(true);
  addActionListener(this);            
}
 
源代码24 项目: java-swing-tips   文件: MainPanel.java
protected TabButton() {
  super();
  setUI(new BasicButtonUI());
  setToolTipText("close this tab");
  setContentAreaFilled(false);
  setFocusable(false);
  setBorder(BorderFactory.createEtchedBorder());
  setBorderPainted(false);
  setRolloverEnabled(true);
}
 
源代码25 项目: java-swing-tips   文件: MainPanel.java
protected TabButton() {
  super();
  setUI(new BasicButtonUI());
  setToolTipText("close this tab");
  setContentAreaFilled(false);
  setFocusable(false);
  setBorder(BorderFactory.createEtchedBorder());
  setBorderPainted(false);
  setRolloverEnabled(true);
}
 
源代码26 项目: java-swing-tips   文件: MainPanel.java
protected TabButton() {
  super();
  setUI(new BasicButtonUI());
  setToolTipText("close this tab");
  setContentAreaFilled(false);
  setFocusable(false);
  setBorder(BorderFactory.createEtchedBorder());
  setBorderPainted(false);
  setRolloverEnabled(true);
}
 
源代码27 项目: Pixelitor   文件: CloseTabButton.java
CloseTabButton(TabViewContainer tab) {
    setPreferredSize(new Dimension(SIZE, SIZE));
    setToolTipText("Close this tab");
    setUI(new BasicButtonUI());
    setContentAreaFilled(false);
    setFocusable(false);
    setBorder(createEtchedBorder());
    setBorderPainted(false);
    addMouseListener(buttonMouseListener);
    setRolloverEnabled(true);
    addActionListener(e -> TabsUI.warnAndCloseTab(tab));
}
 
源代码28 项目: consulo   文件: BranchActionGroupPopup.java
private MyToolbarButton(@Nullable String text, @Nullable Icon icon, @Nullable Icon rolloverIcon) {
  setBorder(JBUI.Borders.empty(0, 2));
  setBorderPainted(false);
  setContentAreaFilled(false);
  setOpaque(false);
  setRolloverEnabled(true);
  Icon regularIcon = chooseNotNull(icon, EmptyIcon.ICON_0);
  setIcon(regularIcon);
  setToolTipText(text);
  setRolloverIcon(chooseNotNull(rolloverIcon, regularIcon));
  update();
  setUI(new BasicButtonUI());
}
 
源代码29 项目: orbit-image-analysis   文件: WindowsOutlookBarUI.java
protected TabButton createTabButton() {
  TabButton button = new TabButton();
  button.setUI(new BasicButtonUI());
  button.setBorder(tabButtonBorder);
  return button;
}
 
源代码30 项目: flutter-intellij   文件: ToolbarComboBoxAction.java
@Override
public void setUI(ButtonUI ui) {
  // We use the BasicButtonUI so we can display a button without a
  // background.
  super.setUI(new BasicButtonUI());
}
 
 类所在包
 同包方法