List of usage examples for javax.swing AbstractButton getHorizontalAlignment
public int getHorizontalAlignment()
From source file:Main.java
public static void main(String[] args) { AbstractButton jb = new JButton("Press Me"); System.out.println(jb.getHorizontalAlignment() == SwingConstants.LEFT); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(jb);//ww w . ja v a 2s . c om f.pack(); f.setVisible(true); }
From source file:Main.java
public static String layoutCustomButton(AbstractButton b, Icon icon, Rectangle viewRect, Rectangle iconRect, Rectangle textRect) {/*from w w w . j av a 2s . co m*/ return layoutComponent(b, b.getText(), icon, b.getIconTextGap(), b.getVerticalAlignment(), b.getHorizontalAlignment(), b.getVerticalTextPosition(), b.getHorizontalTextPosition(), viewRect, iconRect, textRect); }