39 * 40 * <pre> 41 * Border border = comp.getBorder(); 42 * Border margin = new EmptyBorder(10,10,10,10); 43 * comp.setBorder(new CompoundBorder(border, margin)); 44 * </pre> 45 * <p> 46 * <strong>Warning:</strong> 47 * Serialized objects of this class will not be compatible with 48 * future Swing releases. The current serialization support is 49 * appropriate for short term storage or RMI between applications running 50 * the same version of Swing. As of 1.4, support for long term storage 51 * of all JavaBeans™ 52 * has been added to the <code>java.beans</code> package. 53 * Please see {@link java.beans.XMLEncoder}. 54 * 55 * @author David Kloba 56 */ 57 @SuppressWarnings("serial") 58 public class CompoundBorder extends AbstractBorder { 59 protected Border outsideBorder; 60 protected Border insideBorder; 61 62 /** 63 * Creates a compound border with null outside and inside borders. 64 */ 65 public CompoundBorder() { 66 this.outsideBorder = null; 67 this.insideBorder = null; 68 } 69 70 /** 71 * Creates a compound border with the specified outside and 72 * inside borders. Either border may be null. 73 * @param outsideBorder the outside border 74 * @param insideBorder the inside border to be nested 75 */ 76 @ConstructorProperties({"outsideBorder", "insideBorder"}) 77 public CompoundBorder(Border outsideBorder, Border insideBorder) { 78 this.outsideBorder = outsideBorder; 79 this.insideBorder = insideBorder; | 39 * 40 * <pre> 41 * Border border = comp.getBorder(); 42 * Border margin = new EmptyBorder(10,10,10,10); 43 * comp.setBorder(new CompoundBorder(border, margin)); 44 * </pre> 45 * <p> 46 * <strong>Warning:</strong> 47 * Serialized objects of this class will not be compatible with 48 * future Swing releases. The current serialization support is 49 * appropriate for short term storage or RMI between applications running 50 * the same version of Swing. As of 1.4, support for long term storage 51 * of all JavaBeans™ 52 * has been added to the <code>java.beans</code> package. 53 * Please see {@link java.beans.XMLEncoder}. 54 * 55 * @author David Kloba 56 */ 57 @SuppressWarnings("serial") 58 public class CompoundBorder extends AbstractBorder { 59 /** 60 * The outside border. 61 */ 62 protected Border outsideBorder; 63 /** 64 * The inside border. 65 */ 66 protected Border insideBorder; 67 68 /** 69 * Creates a compound border with null outside and inside borders. 70 */ 71 public CompoundBorder() { 72 this.outsideBorder = null; 73 this.insideBorder = null; 74 } 75 76 /** 77 * Creates a compound border with the specified outside and 78 * inside borders. Either border may be null. 79 * @param outsideBorder the outside border 80 * @param insideBorder the inside border to be nested 81 */ 82 @ConstructorProperties({"outsideBorder", "insideBorder"}) 83 public CompoundBorder(Border outsideBorder, Border insideBorder) { 84 this.outsideBorder = outsideBorder; 85 this.insideBorder = insideBorder; |