Browse Source

Note Panel

remotes/origin/server
Alena Bandarovich 11 months ago
parent
commit
cf76379ba9
  1. 45
      src/main/java/ChatClient.java

45
src/main/java/ChatClient.java

@ -6,6 +6,49 @@ import java.io.*;
import java.net.Socket;
public class ChatClient extends JFrame implements KeyListener {
public static class TR extends JFrame {
private JScrollPane jScrollPane;
public TR() throws HeadlessException {
super("Notizen");
this.jScrollPane = jScrollPane;
initComponents();
}
private void initComponents() {
setVisible(true);
setBounds(200, 200, 350, 550);
setPreferredSize(new Dimension(300, 500));
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setResizable(false);
JPanel root = new JPanel();
root.setPreferredSize(new Dimension(300, 500));
setContentPane(root);
}
private JPanel setupPanel(String header) {
JPanel panel = new JPanel();
panel.setPreferredSize(new Dimension(270, 150));
panel.setLayout(new BorderLayout());
JLabel jLabel = new JLabel(header);
jLabel.setHorizontalAlignment(JLabel.LEFT);
panel.add(jLabel, BorderLayout.NORTH);
return panel;
}
}
private String address;
private String connectionFailedMessage;
private Socket connectionToServer;
@ -108,6 +151,8 @@ public class ChatClient extends JFrame implements KeyListener {
}
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> new TR());
new ChatClient();
}
}
Loading…
Cancel
Save