Java Code Examples for javax.swing.AbstractButton#setHorizontalTextPosition()

The following examples show how to use javax.swing.AbstractButton#setHorizontalTextPosition() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BasicOutlookButtonUI.java    From orbit-image-analysis with GNU General Public License v3.0 5 votes vote down vote up
protected void installDefaults(AbstractButton b) {
  super.installDefaults(b);

  b.setRolloverEnabled(true);
  b.setOpaque(false);
  b.setHorizontalTextPosition(JButton.CENTER);
  b.setVerticalTextPosition(JButton.BOTTOM);

  LookAndFeel.installBorder(b, "OutlookButton.border");    
}
 
Example 2
Source File: TGToolBar.java    From tuxguitar with GNU Lesser General Public License v2.1 5 votes vote down vote up
private AbstractButton getImageButton( AbstractButton button, String iconPrefix, String iconSuffix ){
	button.setHorizontalTextPosition(JButton.CENTER);
	button.setVerticalTextPosition(JButton.CENTER);
	button.setBorderPainted( false );
	button.setContentAreaFilled( false );
	button.setFocusPainted( false );
	button.setMargin( new Insets(0,0,0,0) );
	button.setIcon( TGResourceUtils.loadIcon( iconPrefix + iconSuffix ) );
	button.setPressedIcon( TGResourceUtils.loadIcon( iconPrefix + "_pressed" + iconSuffix ) );
	button.setRolloverIcon( TGResourceUtils.loadIcon( iconPrefix + "_over" + iconSuffix ) );
	button.setSelectedIcon( TGResourceUtils.loadIcon( iconPrefix + "_selected" + iconSuffix ) );
	button.setRolloverSelectedIcon( TGResourceUtils.loadIcon( iconPrefix + "_selected_over" + iconSuffix ) );
	return button;
}
 
Example 3
Source File: BasicOutlookButtonUI.java    From CodenameOne with GNU General Public License v2.0 5 votes vote down vote up
protected void installDefaults(AbstractButton b) {
  super.installDefaults(b);

  b.setRolloverEnabled(true);
  b.setOpaque(false);
  b.setHorizontalTextPosition(JButton.CENTER);
  b.setVerticalTextPosition(JButton.BOTTOM);

  LookAndFeel.installBorder(b, "OutlookButton.border");    
}
 
Example 4
Source File: BlueishButtonBarUI.java    From orbit-image-analysis with GNU General Public License v3.0 4 votes vote down vote up
public void installButtonBarUI(AbstractButton button) {
  button.setUI(new BlueishButtonBarButtonUI());
  button.setHorizontalTextPosition(JButton.CENTER);
  button.setVerticalTextPosition(JButton.BOTTOM);
  button.setOpaque(false);
}
 
Example 5
Source File: IconPackagerButtonBarUI.java    From orbit-image-analysis with GNU General Public License v3.0 4 votes vote down vote up
public void installButtonBarUI(AbstractButton button) {
  button.setUI(new ButtonUI());
  button.setHorizontalTextPosition(JButton.CENTER);
  button.setVerticalTextPosition(JButton.BOTTOM);
}