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
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user