본문 바로가기
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.JScrollPane;
import javax.swing.JTextPane;
import java.awt.TextField;
import javax.swing.JButton;
public class woorichat extends JFrame {
private JPanel contentPane;
--*
 * Launch the application.
 --
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
woorichat frame = new woorichat();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
--*
 * Create the frame.
 --
public woorichat() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 352, 454);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JPanel panel = new JPanel();
panel.setBounds(0, 0, 336, 377);
contentPane.add(panel);
panel.setLayout(null);
JTextPane textPaneChat = new JTextPane();
textPaneChat.setEditable(false);
textPaneChat.setBounds(0, 0, 336, 377);
panel.add(textPaneChat);
TextField txtWrite = new TextField();
txtWrite.setBounds(10, 383, 235, 29);
contentPane.add(txtWrite);
JButton btnNewButton = new JButton("send");
btnNewButton.setBounds(251, 387, 85, 23);
contentPane.add(btnNewButton);
}
}

반응형