import javax.swing.JPanel; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.JButton; public class StringPanel extends JPanel { private JTextArea console; private JTextField input; private JButton send; private JTextArea invintory; private JTextArea stats; public StringPanel() { console = new JTextArea(); input = new JTextField(); send = new JButton("Send"); send.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { //code goes here } }); invintory = new JTextArea("Invintory"); stats = new JTextArea(); setupPanel(); } private void setupPanel() { this.add(console); console.setBounds(10, 11, 311, 239); this.add(input); input.setBounds(10, 261, 311, 28); input.setColumns(10); this.add(send); send.setBounds(331, 261, 109, 26); this.add(invintory); invintory.setBounds(331, 89, 109, 161); this.add(stats); stats.setBounds(331, 11, 109, 67); setBackground(Color.GRAY); setLayout(null); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)