コード例 #1
0
ファイル: OptionPaneDemo.java プロジェクト: raviAmlani/java
 public JButton createButton(Action a) {
   JButton b =
       new JButton() {
         public Dimension getMaximumSize() {
           int width = Short.MAX_VALUE;
           int height = super.getMaximumSize().height;
           return new Dimension(width, height);
         }
       };
   // setting the following client property informs the button to show
   // the action text as it's name. The default is to not show the
   // action text.
   b.putClientProperty("displayActionText", Boolean.TRUE);
   b.setAction(a);
   // b.setAlignmentX(JButton.CENTER_ALIGNMENT);
   return b;
 }