Example usage for java.awt Panel Panel

List of usage examples for java.awt Panel Panel

Introduction

In this page you can find the example usage for java.awt Panel Panel.

Prototype

public Panel() 

Source Link

Document

Creates a new panel using the default layout manager.

Usage

From source file:gdsc.smlm.ij.plugins.SpotAnalysis.java

private Panel createChoicePanel(Choice list, String label) {
    Panel panel = new Panel();
    panel.setLayout(new BorderLayout());
    Label listLabel = new Label(label, 0);
    //listLabel.setFont(monoFont);
    //list.setSize(fontWidth * 3, fontWidth);
    panel.add(listLabel, BorderLayout.WEST);
    panel.add(list, BorderLayout.CENTER);
    return panel;
}

From source file:gdsc.smlm.ij.plugins.SpotAnalysis.java

private Panel createTextPanel(TextField textField, String label, String value) {
    Panel panel = new Panel();
    panel.setLayout(new BorderLayout());
    Label listLabel = new Label(label, 0);
    //listLabel.setFont(monoFont);
    //textField.setSize(fontWidth * 3, fontWidth);
    textField.setText(value);/* ww w. j a  v a2  s.  co m*/
    panel.add(listLabel, BorderLayout.WEST);
    panel.add(textField, BorderLayout.CENTER);
    return panel;
}

From source file:gdsc.smlm.ij.plugins.SpotAnalysis.java

private Panel createLabelPanel(Label field, String label, String value) {
    Panel panel = new Panel();
    panel.setLayout(new BorderLayout());
    Label listLabel = new Label(label, 0);
    //listLabel.setFont(monoFont);
    //textField.setSize(fontWidth * 3, fontWidth);
    field.setText(value);/*from  w  w w  .  j a v a2 s .  c o m*/
    panel.add(listLabel, BorderLayout.WEST);
    panel.add(field, BorderLayout.CENTER);
    return panel;
}

From source file:CircleOfSquares.java

RegisterPanel() {

    setLayout(new BorderLayout(5, 5));

    pcRegister = new LabeledRegister(StringTable.pc);
    optopRegister = new LabeledRegister(StringTable.optop);
    frameRegister = new LabeledRegister(StringTable.frame);
    varsRegister = new LabeledRegister(StringTable.vars);

    setBackground(ColorTable.registersAreaColor);

    Panel labeledRegisterPanel = new Panel();
    labeledRegisterPanel.setLayout(new GridLayout(1, 4, 5, 5));

    labeledRegisterPanel.add(pcRegister);
    labeledRegisterPanel.add(optopRegister);
    labeledRegisterPanel.add(frameRegister);
    labeledRegisterPanel.add(varsRegister);

    Label title = new Label(StringTable.Registers, Label.CENTER);
    title.setFont(new Font("Helvetica", Font.BOLD, 11));
    add("West", title);
    add("Center", labeledRegisterPanel);
}

From source file:JVMSimulator.java

RegisterPanel() {

    setLayout(new BorderLayout(5, 5));

    pcRegister = new LabeledRegister(StringTable.pc);
    optopRegister = new LabeledRegister(StringTable.optop);
    frameRegister = new LabeledRegister(StringTable.frame);
    varsRegister = new LabeledRegister(StringTable.vars);

    setBackground(SimData.registersAreaColor);

    Panel labeledRegisterPanel = new Panel();
    labeledRegisterPanel.setLayout(new GridLayout(1, 4, 5, 5));

    labeledRegisterPanel.add(pcRegister);
    labeledRegisterPanel.add(optopRegister);
    labeledRegisterPanel.add(frameRegister);
    labeledRegisterPanel.add(varsRegister);

    Label title = new Label(StringTable.Registers, Label.CENTER);
    title.setFont(new Font("Helvetica", Font.BOLD, 11));
    add("West", title);
    add("Center", labeledRegisterPanel);
}

From source file:Tcpbw100.java

public void diagnose() {
    showStatus(messages.getString("getWeb100Var"));

    if (f == null) {
        f = new clsFrame();
    }//from  ww w .j  a  v a  2  s  . c  om
    f.setTitle(messages.getString("web100Var"));
    Panel buttons = new Panel();
    f.getContentPane().add("South", buttons);

    disMiss = new JButton(messages.getString("close"));
    disMiss.addActionListener(this);

    copy = new JButton(messages.getString("copy"));
    copy.addActionListener(this);

    diagnosis = new JTextArea(messages.getString("web100KernelVar") + ":\n", 15, 30);
    diagnosis.setEditable(true);
    disMiss.setEnabled(true);
    copy.setEnabled(cancopy);

    buttons.add("West", disMiss);
    buttons.add("East", copy);
    f.getContentPane().add(new JScrollPane(diagnosis));
    f.pack();
}

From source file:Tcpbw100.java

public void statistics() {
    showStatus(messages.getString("printDetailedStats"));

    if (ff == null) {
        ff = new clsFrame();
    }/*from  w w  w  .ja  va  2 s  .c  o  m*/
    ff.setTitle(messages.getString("detailedStats"));
    Panel buttons = new Panel();
    ff.getContentPane().add("South", buttons);

    disMiss2 = new JButton(messages.getString("close"));
    disMiss2.addActionListener(this);

    copy2 = new JButton(messages.getString("copy"));
    copy2.addActionListener(this);

    statistics = new JTextArea(messages.getString("web100Stats") + ":\n", 25, 70);
    statistics.setEditable(true);
    disMiss2.setEnabled(true);
    copy2.setEnabled(cancopy);

    buttons.add("West", disMiss2);
    buttons.add("East", copy2);
    ff.getContentPane().add(new JScrollPane(statistics));
    ff.pack();
}

From source file:Tcpbw100.java

public void showOptions() {
    showStatus(messages.getString("showOptions"));

    if (optionsFrame == null) {
        optionsFrame = new clsFrame();
        optionsFrame.setTitle(messages.getString("options"));

        JPanel optionsPanel = new JPanel();
        optionsPanel.setLayout(new BoxLayout(optionsPanel, BoxLayout.Y_AXIS));

        JPanel testsPanel = new JPanel();
        testsPanel.setBorder(BorderFactory.createTitledBorder(messages.getString("performedTests")));
        testsPanel.add(defaultTest);/*from   w  w  w .j ava 2 s.  c o m*/
        optionsPanel.add(testsPanel);

        JPanel protocolPanel = new JPanel();
        protocolPanel.setBorder(BorderFactory.createTitledBorder(messages.getString("ipProtocol")));
        protocolPanel.add(preferIPv6);
        optionsPanel.add(protocolPanel);

        if (getParameter("enableMultipleTests") != null) {
            JPanel generalPanel = new JPanel();
            generalPanel.setLayout(new BoxLayout(generalPanel, BoxLayout.Y_AXIS));
            generalPanel.setBorder(BorderFactory.createTitledBorder(messages.getString("general")));
            JPanel tmpPanel = new JPanel();
            tmpPanel.add(new JLabel(messages.getString("numberOfTests") + ":"));
            tmpPanel.add(numOfTests);
            generalPanel.add(tmpPanel);
            tmpPanel = new JPanel();
            tmpPanel.add(new JLabel(messages.getString("delayBetweenTests") + ":"));
            tmpPanel.add(delay);
            generalPanel.add(tmpPanel);

            optionsPanel.add(generalPanel);
        }

        optionsFrame.getContentPane().add(optionsPanel);
        Panel buttons = new Panel();
        optionsFrame.getContentPane().add("South", buttons);

        JButton okButton = new JButton(messages.getString("ok"));
        okButton.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                optionsFrame.toBack();
                optionsFrame.dispose();
            }

        });

        buttons.add("West", okButton);

        optionsFrame.pack();
    }
    optionsFrame.setResizable(false);
    optionsFrame.setVisible(true);
}