본문 바로가기
SpringBoot

채팅프로그램(방채팅_GUI)

by ByteBridge 2013. 2. 20.
반응형



package com.wooriclient;
--*
 * 채팅방 GUI
 --
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.border.BevelBorder;
import java.awt.TextField;
import java.awt.Font;
import java.awt.TextArea;
import javax.swing.JTextPane;
import javax.swing.JButton;
import javax.swing.JList;
public class wooriChatRoom extends JFrame {
private JPanel contentPane;
--*
 * Launch the application.
 --
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
wooriChatRoom frame = new wooriChatRoom();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
--*
 * Create the frame.
 --
public wooriChatRoom() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 530, 464);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JPanel panel = new JPanel();
panel.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
panel.setBounds(0, 43, 336, 383);
contentPane.add(panel);
panel.setLayout(null);
JTextPane txtRoomChat = new JTextPane();
txtRoomChat.setEditable(false);
txtRoomChat.setBounds(0, 0, 336, 334);
panel.add(txtRoomChat);
TextField txtRoomChatWrite = new TextField();
txtRoomChatWrite.setBounds(10, 340, 241, 33);
panel.add(txtRoomChatWrite);
JButton btnRoomSend = new JButton("send");
btnRoomSend.setBounds(259, 344, 65, 29);
panel.add(btnRoomSend);
JPanel panel_1 = new JPanel();
panel_1.setBorder(new BevelBorder(BevelBorder.LOWERED, null, null, null, null));
panel_1.setBounds(348, 0, 166, 426);
contentPane.add(panel_1);
panel_1.setLayout(null);
TextField textField_1 = new TextField();
textField_1.setBounds(35, 7, 96, 21);
textField_1.setText("\uC811\uC18D\uBA64\uBC84");
textField_1.setFont(new Font("Dialog", Font.BOLD, 17));
textField_1.setEnabled(false);
textField_1.setEditable(false);
panel_1.add(textField_1);
JList listRoomMember = new JList();
listRoomMember.setBounds(12, 47, 142, 369);
panel_1.add(listRoomMember);
TextField textField = new TextField();
textField.setEnabled(false);
textField.setEditable(false);
textField.setFont(new Font("Dialog", Font.BOLD, 17));
textField.setText("ChatRoom");
textField.setBounds(109, 14, 101, 23);
contentPane.add(textField);
}
}

반응형