📄 chatframe.java
字号:
package client.chat.chatpane;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.io.InputStream;
import java.io.OutputStream;
import javax.swing.JFrame;
import javax.swing.JPanel;
/**
* 聊天窗口主界面
* @author 洪景泉
*
*/
public class ChatFrame extends JFrame{
private static final long serialVersionUID = 3998610105594354937L;
private TopPane topPane=null;
private LeftPane lPane=null;
private RightPane rPane=null;
private JPanel lrPane =null;
/**
* 构造函数
* @param title 窗口标题栏要显示的标题
* @param is 输入流
* @param os 输出流
*/
public ChatFrame(String title,InputStream is, OutputStream os) {
super(title);
topPane=new TopPane(this,is,os);
lPane=new LeftPane(this,is,os);
rPane=new RightPane(this);
lrPane=new JPanel();
// lPane.setPreferredSize(new Dimension(280,50));
rPane.setPreferredSize(new Dimension(200,50));
lrPane.setLayout(new BorderLayout(0,0));
lrPane.add(lPane,BorderLayout.CENTER);
lrPane.add(rPane,BorderLayout.EAST);
this.setLayout(new BorderLayout());
this.add(topPane,BorderLayout.NORTH);
this.add(lrPane,BorderLayout.CENTER);
this.setSize(600,550);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setIconImage(this.getToolkit().getImage("./image/total/qqicon.gif"));
this.setVisible(true);
}
// public static void main(String[] args) {
// new ChatFrame("聊天界面");
// }
public LeftPane getLPane() {
return lPane;
}
public RightPane getRPane() {
return rPane;
}
public TopPane getTopPane() {
return topPane;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -