Example usage for java.awt Panel add

List of usage examples for java.awt Panel add

Introduction

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

Prototype

public Component add(String name, Component comp) 

Source Link

Document

Adds the specified component to this container.

Usage

From source file:Tcpbw100.java

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

    if (f == null) {
        f = new clsFrame();
    }/*ww  w .ja v a 2s.co  m*/
    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();
    }//  w  ww.  j  a  va2s.com
    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();
}