import java.awt.*;

import javax.swing.*;
/*
 * NewJFrame.java
 *
 * Created on 18 May 2009, 19:03
 */


/**
 *
 * @author  arvad04
 */
public class CopyOfGUI extends javax.swing.JFrame {
    
    final static boolean shouldFill = true;
    final static boolean shouldWeightX = true;
    final static boolean RIGHT_TO_LEFT = false;

    /** Creates new form NewJFrame */
    public CopyOfGUI() {
        initComponents();
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

    	 //Create and set up the window.
        JFrame frame = new JFrame("GridBagLayoutDemo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        //Set up the content pane.
        Container pane = frame.getContentPane();

        if (RIGHT_TO_LEFT) {
            pane.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
        }

        inputTextField = new javax.swing.JTextField();
        jScrollPane = new javax.swing.JScrollPane();
        outputTextArea = new javax.swing.JTextArea();
        commitInputButton = new JButton("Send command");
        
        commitInputButton.setPreferredSize(new Dimension(150,30));
        outputTextArea.setColumns(50);
        outputTextArea.setRows(30);
        jScrollPane.setViewportView(outputTextArea);
        
        
		pane.setLayout(new GridBagLayout());
		GridBagConstraints c = new GridBagConstraints();
		if (shouldFill) {
			//natural height, maximum width
			c.fill = GridBagConstraints.HORIZONTAL;
			//c.fill = GridBagConstraints.NONE;
		}
	
		
		if (shouldWeightX) {
		c.weightx = 0.5;
		}
		c.insets = new Insets(20,10,20,10);
		//c.fill = GridBagConstraints.HORIZONTAL;
		c.gridx = 1;
		c.gridy = 1;
		pane.add(outputTextArea, c);
	
		//button = new JButton("Button 2");
		c.fill = GridBagConstraints.BOTH;
		c.weightx = 0.5;
		c.gridx = 1;
		c.gridy = 2;
		pane.add(inputTextField, c);
	
		//button = new JButton("Button 3");
		c.fill = GridBagConstraints.NONE;
		c.weightx = 0.0;
		c.gridx = 2;
		c.gridy = 2;
		pane.add(commitInputButton, c);
	
		//button = new JButton("Long-Named Button 4");
		c.fill = GridBagConstraints.HORIZONTAL;
		c.ipady = 40;      //make this component tall
		c.weightx = 0.0;
		c.gridwidth = 3;
		c.gridx = 0;
		c.gridy = 1;
		//pane.add(button, c);
	
		//button = new JButton("5");
		c.fill = GridBagConstraints.HORIZONTAL;
		c.ipady = 0;       //reset to default
		c.weighty = 1.0;   //request any extra vertical space
		c.anchor = GridBagConstraints.PAGE_END; //bottom of space
		c.insets = new Insets(10,0,0,0);  //top padding
		c.gridx = 1;       //aligned with button 2
		c.gridwidth = 2;   //2 columns wide
		c.gridy = 2;       //third row
		//pane.add(button, c);

        
        //Display the window.
        frame.pack();
        frame.setVisible(true);


        /*jTextField1 = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jTextField1.setText("jTextField1");

        jTextArea1.setColumns(20);
        jTextArea1.setRows(5);
        jScrollPane1.setViewportView(jTextArea1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(136, 136, 136)
                        .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(54, 54, 54)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(84, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(86, Short.MAX_VALUE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(53, 53, 53)
                .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(47, 47, 47))
        );

        pack();*/
    }// </editor-fold>
    
    /**
     * @param args the command line arguments
     */
    /*public static void main(String args[]) {
        
    }*/
    
    // Variables declaration - do not modify
    private JScrollPane jScrollPane;
    private JTextArea outputTextArea;
    private JTextField inputTextField;
    private JButton commitInputButton;
    // End of variables declaration
    
}
