packagecom.swift;importjava.awt.BorderLayout;importjava.awt.Dimension;importjava.awt.EventQueue;importjava.awt.FlowLayout;importjavax.swing.ImageIcon;importjavax.swing.JButton;importjavax.swing.JDialog;importjavax.swing.JFrame;importjavax.swing.JLabel;importjavax.swing.JPanel;importjavax.swing.JScrollPane;importjavax.swing.JSplitPane;importjavax.swing.JTextArea;importjavax.swing.UIManager;importjavax.swing.UnsupportedLookAndFeelException;public class ChatFrame extendsJFrame {privateJTextArea textArea_1;privateJTextArea textArea;public static voidmain(String args[]) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);try{
UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
}catch(ClassNotFoundException e1) {//TODO Auto-generated catch block
e1.printStackTrace();
}catch(InstantiationException e1) {//TODO Auto-generated catch block
e1.printStackTrace();
}catch(IllegalAccessException e1) {//TODO Auto-generated catch block
e1.printStackTrace();
}catch(UnsupportedLookAndFeelException e1) {//TODO Auto-generated catch block
e1.printStackTrace();
}
EventQueue.invokeLater(newRunnable() {public voidrun() {try{
ChatFrame frame= newChatFrame();
frame.setVisible(true);
}catch(Exception e) {
e.printStackTrace();
}
}
});
}publicChatFrame() {super();
setTitle("飞燕—聊天窗");
setBounds(100, 100, 558, 576);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);final JPanel panel = newJPanel();
panel.setLayout(new BorderLayout(5,5));
getContentPane().add(panel, BorderLayout.NORTH);final JLabel label = new JLabel(new ImageIcon("Images/logo.jpg"));
panel.add(label, BorderLayout.WEST);
label.setText("New JLabel");
label.setPreferredSize(new Dimension(74,74));final JPanel panel_1 = newJPanel();
panel_1.setLayout(newBorderLayout());
panel.add(panel_1, BorderLayout.CENTER);final JLabel advancingSwiftLabel = newJLabel();
advancingSwiftLabel.setText("Advancing Swift");
panel_1.add(advancingSwiftLabel, BorderLayout.CENTER);final JLabel neverWasteTimeLabel = newJLabel();
neverWasteTimeLabel.setText("Never waste time any more");
panel_1.add(neverWasteTimeLabel, BorderLayout.SOUTH);final JSplitPane splitPane = newJSplitPane();
splitPane.setDividerLocation(300);
splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
getContentPane().add(splitPane, BorderLayout.CENTER);final JPanel panel_2 = newJPanel();
panel_2.setLayout(newBorderLayout());
splitPane.setRightComponent(panel_2);final JPanel panel_3 = newJPanel();final FlowLayout flowLayout = newFlowLayout();
flowLayout.setAlignment(FlowLayout.LEFT);
panel_3.setLayout(flowLayout);
panel_2.add(panel_3, BorderLayout.NORTH);final JButton button = newJButton();
button.setText("字体");
panel_3.add(button);final JPanel panel_4 = newJPanel();final FlowLayout flowLayout_1 = newFlowLayout();
flowLayout_1.setAlignment(FlowLayout.RIGHT);
panel_4.setLayout(flowLayout_1);
panel_2.add(panel_4, BorderLayout.SOUTH);final JButton button_1 = newJButton();
button_1.setText("关闭");
panel_4.add(button_1);final JButton button_2 = newJButton();
button_2.setText("发送");
panel_4.add(button_2);final JScrollPane scrollPane = newJScrollPane();
panel_2.add(scrollPane, BorderLayout.CENTER);
textArea_1= newJTextArea();
scrollPane.setViewportView(textArea_1);final JScrollPane scrollPane_1 = newJScrollPane();
splitPane.setLeftComponent(scrollPane_1);
textArea= newJTextArea();
scrollPane_1.setViewportView(textArea);
}
}