package gui;
import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
public class ShoutPanel extends JPanel {
JTextArea shoutText;
JScrollPane scrollPane;
public ShoutPanel() {
setLayout(new GridBagLayout());
shoutText = new JTextArea("SHOUTBOX:\n");
scrollPane = new JScrollPane();
scrollPane.setViewportView( shoutText );
shoutText.setEditable(false);
shoutText.setAlignmentY(JTextArea.CENTER_ALIGNMENT);
shoutText.setBackground(new Color(240,240,240));
add(scrollPane, new GridBagConstraints(0, 0, 0, 0, 1.0, 1.0, GridBagConstraints.NORTH, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
}
public void write(String s) {
String temp = shoutText.getText();
temp+=s+"\n";
shoutText.setText(temp);
}
}