UI proof of concept (discussion)

This commit is contained in:
basti 2020-12-04 15:30:59 +01:00
parent f8a2e59d69
commit c4cb34c14d

View file

@ -0,0 +1,75 @@
package ui;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JScrollBar;
public class DiscussionUI extends JFrame {
private JPanel contentPane;
private JTextField textField;
private JTextField historicField;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
DiscussionUI frame = new DiscussionUI();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public DiscussionUI() {
setTitle("Discussion");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setBounds(21, 11, 403, 164);
contentPane.add(scrollPane);
historicField = new JTextField();
historicField.setEditable(false);
scrollPane.setViewportView(historicField);
historicField.setColumns(10);
JScrollBar scrollBar = new JScrollBar();
scrollPane.setRowHeaderView(scrollBar);
textField = new JTextField();
textField.setBounds(21, 197, 301, 42);
contentPane.add(textField);
textField.setColumns(10);
JButton sendButton = new JButton("Send");
sendButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
}
});
sendButton.setBounds(335, 207, 89, 23);
contentPane.add(sendButton);
}
}