From 96315f2d5d88d050e44b94586334f635c30a6bd7 Mon Sep 17 00:00:00 2001 From: mdb Date: Fri, 4 Mar 2005 22:00:24 +0000 Subject: [PATCH] Made makeButtonBox() more convenient for wrapping a single button (to avoid having it stretched which one commonly needs). git-svn-id: https://samskivert.googlecode.com/svn/trunk@1606 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../src/java/com/samskivert/swing/GroupLayout.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/projects/samskivert/src/java/com/samskivert/swing/GroupLayout.java b/projects/samskivert/src/java/com/samskivert/swing/GroupLayout.java index 2c64a967..d6ccfecc 100644 --- a/projects/samskivert/src/java/com/samskivert/swing/GroupLayout.java +++ b/projects/samskivert/src/java/com/samskivert/swing/GroupLayout.java @@ -22,6 +22,7 @@ package com.samskivert.swing; import java.awt.*; +import javax.swing.JComponent; import javax.swing.JPanel; import java.util.HashMap; @@ -358,6 +359,19 @@ public abstract class GroupLayout return new JPanel(new HGroupLayout(NONE, justification)); } + /** + * Creates a {@link JPanel} that is configured with an {@link + * HGroupLayout} with a configuration conducive to containing a row of + * buttons. The supplied button is added to the box. + */ + public static JPanel makeButtonBox ( + Justification justification, JComponent button) + { + JPanel box = new JPanel(new HGroupLayout(NONE, justification)); + box.add(button); + return box; + } + /** * Creates a {@link JPanel} that is configured with an {@link * HGroupLayout} with the default configuration.