Search in sources :

Example 46 with Panel

use of java.awt.Panel in project voltdb by VoltDB.

the class Transfer method createBorderPanel.

/**
     * Method declaration
     *
     *
     * @param center
     */
private Panel createBorderPanel(Component center) {
    Panel p = new Panel();
    p.setBackground(SystemColor.control);
    p.setLayout(new BorderLayout());
    p.add("Center", center);
    p.add("South", createLabel(""));
    p.add("East", createLabel(""));
    p.add("West", createLabel(""));
    p.setBackground(SystemColor.control);
    return p;
}
Also used : Panel(java.awt.Panel) BorderLayout(java.awt.BorderLayout)

Example 47 with Panel

use of java.awt.Panel in project GDSC-SMLM by aherbert.

the class MultiDialog method buildPanels.

protected Panel buildPanels() {
    Panel p = new Panel();
    BorderLayout layout = new BorderLayout();
    layout.setVgap(3);
    p.setLayout(layout);
    p.add(buildResultsList(), BorderLayout.NORTH, 0);
    p.add(buildButtonPanel(), BorderLayout.CENTER, 1);
    return p;
}
Also used : Panel(java.awt.Panel) BorderLayout(java.awt.BorderLayout)

Example 48 with Panel

use of java.awt.Panel in project voltdb by VoltDB.

the class ZaurusTableForm method initGUI.

private void initGUI() {
    Panel pEntry = new Panel();
    pEntry.setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.insets = new Insets(3, 3, 3, 3);
    c.gridwidth = 1;
    c.gridheight = 1;
    c.weightx = c.weighty = 1;
    c.anchor = GridBagConstraints.WEST;
    komponente = new ZaurusComponent[columns.length];
    for (int i = 0; i < columns.length; i++) {
        c.gridy = i;
        c.gridx = 0;
        pEntry.add(new Label((String) columns[i]), c);
        c.gridx = 1;
        int constraint = this.getConstraintIndex(i);
        if (constraint >= 0 && imColIndex[constraint].length == 1) {
            // we use ony foreign keys with one index
            ZaurusChoice tmp = new ZaurusChoice();
            this.fillZChoice(tmp, refTables[constraint], refColumns[constraint][0]);
            tmp.addItemListener(this);
            komponente[i] = tmp;
            pEntry.add(tmp, c);
        } else if (columnTypes[i] == java.sql.Types.DATE) {
            //              System.out.println("hier gibt es eine Date-Spalte namens "+columns[i]);
            ZaurusTextField tmp = new ZaurusTextField(8);
            tmp.addTextListener(this);
            pEntry.add(tmp, c);
            komponente[i] = tmp;
        } else {
            ZaurusTextField tmp = new ZaurusTextField(5);
            tmp.addTextListener(this);
            pEntry.add(tmp, c);
            komponente[i] = tmp;
        }
        komponente[i].setEditable(true);
    }
    this.add(pEntry);
}
Also used : Panel(java.awt.Panel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) Label(java.awt.Label)

Example 49 with Panel

use of java.awt.Panel in project voltdb by VoltDB.

the class ZaurusEditor method initButtons.

// init the three boxes for buttons
private void initButtons() {
    // the buttons for the search form
    bSearchRow = new Button("Search Rows");
    bNewRow = new Button("Insert New Row");
    bSearchRow.addActionListener(this);
    bNewRow.addActionListener(this);
    pSearchButs = new Panel();
    pSearchButs.setLayout(new GridLayout(1, 0, 4, 4));
    pSearchButs.add(bSearchRow);
    pSearchButs.add(bNewRow);
    // the buttons for editing a row
    bCancel1 = new Button("Cancel");
    bPrev = new Button("Prev");
    bNext = new Button("Next");
    bDelete = new Button("Delete");
    lastButtonDelete = false;
    bNewSearch = new Button("Search");
    bCancel1.addActionListener(this);
    bPrev.addActionListener(this);
    bNext.addActionListener(this);
    bDelete.addActionListener(this);
    bNewSearch.addActionListener(this);
    pEditButs = new Panel();
    pEditButs.setLayout(new GridLayout(1, 0, 4, 4));
    pEditButs.add(bCancel1);
    pEditButs.add(bPrev);
    pEditButs.add(bNext);
    pEditButs.add(bDelete);
    pEditButs.add(bNewSearch);
    // the buttons for inserting a new row
    pInsertButs = new Panel();
    pInsertButs.setLayout(new GridLayout(1, 0, 4, 4));
    bCancel2 = new Button("Cancel Insert");
    bNewInsert = new Button("New Insert");
    bNewSearch1 = new Button("Search");
    bCancel2.addActionListener(this);
    bNewInsert.addActionListener(this);
    bNewSearch1.addActionListener(this);
    pInsertButs.add(bCancel2);
    pInsertButs.add(bNewInsert);
    pInsertButs.add(bNewSearch1);
}
Also used : Panel(java.awt.Panel) GridLayout(java.awt.GridLayout) Button(java.awt.Button)

Example 50 with Panel

use of java.awt.Panel in project jdk8u_jdk by JetBrains.

the class CardTest method create.

Panel create(LayoutManager layout) {
    Button b = null;
    Panel p = new Panel();
    p.setLayout(layout);
    b = new Button("one");
    b.addActionListener(listener);
    p.add("North", b);
    b = new Button("two");
    b.addActionListener(listener);
    p.add("West", b);
    b = new Button("three");
    b.addActionListener(listener);
    p.add("South", b);
    b = new Button("four");
    b.addActionListener(listener);
    p.add("East", b);
    b = new Button("five");
    b.addActionListener(listener);
    p.add("Center", b);
    b = new Button("six");
    b.addActionListener(listener);
    p.add("Center", b);
    return p;
}
Also used : Panel(java.awt.Panel) Button(java.awt.Button)

Aggregations

Panel (java.awt.Panel)70 BorderLayout (java.awt.BorderLayout)26 Button (java.awt.Button)25 Label (java.awt.Label)25 Frame (java.awt.Frame)18 GridBagLayout (java.awt.GridBagLayout)17 TextField (java.awt.TextField)17 GridBagConstraints (java.awt.GridBagConstraints)16 JPanel (javax.swing.JPanel)14 Dimension (java.awt.Dimension)13 Insets (java.awt.Insets)10 Point (java.awt.Point)10 Choice (java.awt.Choice)9 FlowLayout (java.awt.FlowLayout)9 Graphics (java.awt.Graphics)9 Checkbox (java.awt.Checkbox)7 GridLayout (java.awt.GridLayout)7 Font (java.awt.Font)6 JButton (javax.swing.JButton)6 Component (java.awt.Component)5