I do not know how

how to add some button at my bottom?
import java.awt.BorderLayout;
import java.awt.Color;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.WindowConstants;
import com.jgoodies.forms.builder.PanelBuilder;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;
public final class anotherSubMenu extends JPanel {
     private JTextField inspectorField;
    private JTextField referenceNoField;
    private JTextField     anotherNew;
    private JComboBox  approvalStatusComboBox;
    private JPanel button;
     private JButton add;
     private JButton clear;
     private JButton edit;
     public anotherSubMenu(){
          setLayout(new BorderLayout());
          setBackground(Color.white); 
          System.out.println("test1");
                add = new JButton("Add");
              clear = new JButton("Delete");
              edit = new JButton("Edit");
              System.out.println("test2");
             buildButton();
             add(button, BorderLayout.SOUTH);
    public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel("com.jgoodies.plaf.plastic.PlasticXPLookAndFeel");
        } catch (Exception e) {
            // Likely PlasticXP is not in the class path; ignore.
        JFrame frame = new JFrame();
        frame.setTitle("Member Information Center!");
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        JComponent panel = new anotherSubMenu().buildPanel();
        frame.getContentPane().add(panel);
        frame.pack();
        frame.setVisible(true);
    private void buildButton() {
          // TODO Auto-generated method stub
          button = new JPanel();
          button.add(add);
          button.add(clear);
          button.add(edit);          
     private void initComponents() {
        inspectorField         = new JTextField();
        referenceNoField       = new JTextField();
        anotherNew                  = new JTextField();
        approvalStatusComboBox = createApprovalStatusComboBox();
    private JComboBox createApprovalStatusComboBox() {
        return new JComboBox(
            new String[] { "Sungai Besi", "Damansara", "Taman Megah" ,"Cheras"});
    public JComponent buildPanel() {
          initComponents();
         FormLayout layout = new FormLayout(
                 "right:max(40dlu;pref), 3dlu, 70dlu, 7dlu, "
               + "right:max(40dlu;pref), 3dlu, 70dlu",
                 "p, 3dlu, p, 3dlu, p, 3dlu, p, 9dlu, " +
                 "p, 3dlu, p, 3dlu, p, 3dlu, p, 9dlu, " +
                 "p, 3dlu, p, 3dlu, p, 3dlu, p");
         PanelBuilder builder = new PanelBuilder(layout);
         builder.setDefaultDialogBorder();
         CellConstraints cc = new CellConstraints();
         // Fill the table with labels and components.
         builder.addSeparator("Update Center.",    cc.xyw(1,  1, 7));
         builder.addLabel("Name",             cc.xy (1,3));
         builder.add(inspectorField,          cc.xyw(3, 3, 3));
         builder.addLabel("ID_NUM",     cc.xy (1, 5));
         builder.add(referenceNoField,        cc.xy (3, 5));
         builder.addLabel("Address",          cc.xy(1, 7));
         builder.add(anotherNew,               cc.xyw(3, 7,5));
         builder.addLabel("Branch",           cc.xy (1, 9));
         builder.add(approvalStatusComboBox,  cc.xy (3, 9));
         return builder.getPanel();
   

this code i change again..the Jgoodies part is fine..juz correct the way i put them together..help..
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.UIManager;
import javax.swing.WindowConstants;
import com.jgoodies.forms.builder.PanelBuilder;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;
public class newSubMenu extends JFrame{
     private JTextField inspectorField;
    private JTextField referenceNoField;
    private JTextField     anotherNew;
    private JComboBox  approvalStatusComboBox;
    private JPanel button;
    private JPanel upperPart;
    private JPanel insidePart;
     private JButton add;
     private JButton clear;
     private JButton edit;
     private static final long serialVersionUID = 1L;
     public newSubMenu (){
          super("Client User Interface");
          addWindowListener(new WindowAdapter(){
               public void windowClosing(WindowEvent e){
                    System.exit(0);
          add = new JButton("Add");
         clear = new JButton("Delete");
         edit = new JButton("Edit");
          buildMenu();
          //buildButton();
          add(button, BorderLayout.SOUTH);
          add(insidePart,BorderLayout.NORTH);
          buildPanel();
     private void buildMenu(){
          JMenuBar mb = new JMenuBar();
          JMenu file = new JMenu("File");
          JMenu edit = new JMenu("Edit");
          JMenu source = new JMenu("Source");
          JMenuItem item = new JMenuItem("Exit");
          //Closes the application from the Exit
          //menu item.
          item.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent e){
                    System.exit(0);
          });// Ends buildMenu method
          file.add(item);
          mb.add(file);
          mb.add(edit);
          mb.add(source);
          setJMenuBar(mb);     
     public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel("com.jgoodies.plaf.plastic.PlasticXPLookAndFeel");
        } catch (Exception e) {
            // Likely PlasticXP is not in the class path; ignore.
        JFrame frame = new JFrame();
        frame.setTitle("Member Information Center!");
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        JComponent panel = new anotherSubMenu().buildPanel();
        frame.getContentPane().add(panel);
        frame.pack();
        frame.setVisible(true);
     private void buildPanel(){
          upperPart = new JPanel();
          setLayout(new BorderLayout());
          upperPart.setBackground(Color.white);
          upperPart.add(buildButton());
          upperPart.add(insidePart());
     private Component insidePart() {
          initComponents();
        FormLayout layout = new FormLayout(
                "right:max(40dlu;pref), 3dlu, 70dlu, 7dlu, "
              + "right:max(40dlu;pref), 3dlu, 70dlu",
                "p, 3dlu, p, 3dlu, p, 3dlu, p, 9dlu, " +
                "p, 3dlu, p, 3dlu, p, 3dlu, p, 9dlu, " +
                "p, 3dlu, p, 3dlu, p, 3dlu, p");
        PanelBuilder builder = new PanelBuilder(layout);
        builder.setDefaultDialogBorder();
        CellConstraints cc = new CellConstraints();
        // Fill the table with labels and components.
        builder.addSeparator("Update Center.",    cc.xyw(1,  1, 7));
        builder.addLabel("Name",             cc.xy (1,3));
        builder.add(inspectorField,          cc.xyw(3, 3, 3));
        builder.addLabel("ID_NUM",     cc.xy (1, 5));
        builder.add(referenceNoField,        cc.xy (3, 5));
        builder.addLabel("Address",          cc.xy(1, 7));
        builder.add(anotherNew,               cc.xyw(3, 7,5));
        builder.addLabel("Branch",           cc.xy (1, 9));
        builder.add(approvalStatusComboBox,  cc.xy (3, 9));
        return builder.getPanel();
     private Component buildButton() {
          // TODO Auto-generated method stub
          button = new JPanel();
          button.add(add);
          button.add(clear);
          return button.add(edit);          
     private void initComponents() {
        inspectorField         = new JTextField();
        referenceNoField       = new JTextField();
        anotherNew                  = new JTextField();
        approvalStatusComboBox = createApprovalStatusComboBox();
    private JComboBox createApprovalStatusComboBox() {
        return new JComboBox(
            new String[] { "Sungai Besi", "Damansara", "Taman Megah" ,"Cheras"});
}

Similar Messages

Maybe you are looking for

  • FCC Paramenters for Sender File Adapter

    hi I am using FCC in the Sender File Adapter. I have defined the structure as below. Fields ID, Filename, Values will be generated at Runtime as I have defined Used Defined Funtions for Both. Only I will Pass the value in Body. i.e "Hello". So How sh

  • Am i able to downgrade my IOS 7.1 to IOS 7

    Am i able to downgrade my IOS 7.1 to IOS 7

  • Extracting details from oracle business rule repository

    Hi, Which of the oracle business rule APIs provide retrieving following details : 1. Get all dictionaries stored in the oracle business rule repository. 2. in each dictionary, 2.1. How to retrieve all ruleset list in a rulesets 2.2 How to retrieve al

  • Data Scaling Error

    Hi, I am working through the tutorial file for NI Lookout 6.2. I have attached a screenshot of a Data Scaling Error problem  following completion of the section "Configure Data for Logging, Scaling and Alarms" on page 8 of the tutorial. In the attach

  • Stylesheet help needed

    Created a stylesheet for multiple page website.  Works as expected on my computer.  Uploaded all files but the background image doesn't show up in any files.  Can someone explain what I did wrong?  I know there's more to do on the site but I'm just b