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.