All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gov.nih.nlm.nls.lvg.Tools.GuiTool.GuiComp.OkButtonPanel Maven / Gradle / Ivy

The newest version!
package GuiTool.GuiComp; 
import java.awt.*;
import javax.swing.*;
import GuiTool.GuiLib.*;
public class OkButtonPanel extends JPanel
{
    public OkButtonPanel()
    {
        okB_ = new JButton("Ok");
        GridBagLayout gbl = new GridBagLayout();
        setLayout(gbl);
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.fill = GridBagConstraints.HORIZONTAL;
        gbc.anchor = GridBagConstraints.CENTER;
        gbc.insets = new Insets(20, 5, 5, 5);  //Pad: Top, Left, Bottom, Right
        GridBag.SetWeight(gbc, 0, 100);
        GridBag.SetPosSize(gbc, 0, 0, 1, 1);
        add(okB_, gbc);
    }
    public JButton GetOkButton()
    {
        return okB_;
    }
    public static void main(String[] args)
    {
        JFrame frame = new LibCloseableFrame("Ok Panel");
        frame.getContentPane().add(new OkButtonPanel(), "South");
        
        frame.setSize(300, 200);
        frame.setVisible(true);
    }
    // data members
    private JButton okB_ = null;
    private final static long serialVersionUID = 5L;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy