1 18 19 package de.gulden.framework.amoda.environment.gui.component; 20 21 import de.gulden.framework.amoda.environment.commandline.*; 22 import java.awt.*; 23 import java.lang.*; 24 import java.util.*; 25 import javax.swing.JButton ; 26 27 33 public class DefaultButton extends JButton { 34 35 39 public static Dimension BUTTON_DEFAULT_SIZE = new Dimension(80,25); 40 41 42 46 public DefaultButton() { 47 super(); 48 } 49 50 public DefaultButton(String label) { 51 super(label); 52 } 53 54 55 59 public Dimension getPreferredSize() { 60 Dimension d = super.getPreferredSize(); 61 if (d.width < BUTTON_DEFAULT_SIZE.width) { 62 d.width = BUTTON_DEFAULT_SIZE.width; 63 } 64 if (d.height < BUTTON_DEFAULT_SIZE.height) { 65 d.height = BUTTON_DEFAULT_SIZE.height; 66 } 67 return d; 68 } 69 70 } | Popular Tags |