/** * Picks a card when a button is pressed. */ import javax.swing.*; import java.awt.BorderLayout; import java.awt.Color; import java.awt.event .*; public class DBFrame extends JFrame { public DBFrame() { super("Database"); setSize(400, 600); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); textArea = new JTextArea(); textArea.setEditable(false); textArea.setLineWrap(true); textArea.append("Welcome to the Animal Database"); JScrollPane scrollPane1 = new JScrollPane(textArea); add(scrollPane1,BorderLayout.CENTER); setVisible(true); } public void print(String s) { textArea.append(s); } public void println(String s) { textArea.append(s + "\n"); } public void clear() { textArea.setText(""); } public static void main(String[] args) { DBFrame frame = new DBFrame(); for (int i = 0; i < 1000; i++) { frame.println("bla " + "\u2660"); } } private JTextArea textArea; private JTextField textfield; }