📄 chesi.java
字号:
package welcome;
import java.awt.*;
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.Rectangle;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class Frame1
extends JFrame {
BorderLayout borderLayout1 = new BorderLayout();
JTextPane jTextPane1 = new JTextPane();
JTextPane jTextPane2 = new JTextPane();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JPanel jPanel2 = new JPanel();
JPanel jPanel1 = new JPanel();
JLabel jLabel1 = new JLabel(new ImageIcon("img//zhiyin.jpg"));
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
JToolBar jToolBar1 = new JToolBar();
JToolBar jToolBar2 = new JToolBar();
JToggleButton jToggleButton1 = new JToggleButton();
JToolBar jToolBar3 = new JToolBar();
JToggleButton jToggleButton2 = new JToggleButton();
JToolBar jToolBar4 = new JToolBar();
public Frame1(String qname) {
super(qname);
try {
jbInit();
}
catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane().setLayout(null);
jTextPane1.setBounds(new Rectangle(3, 24, 324, 223));
this.getContentPane().setBackground(SystemColor.textHighlight);
this.setForeground(UIManager.getColor("TextPane.selectionBackground"));
jPanel2.setBackground(SystemColor.controlHighlight);
jPanel2.setBounds(new Rectangle(333, 21, 148, 163));
jPanel2.setLayout(null);
jButton2.setBounds(new Rectangle(229, 350, 83, 29));
jButton2.setText("发送");
jButton2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
jButton2_actionPerformed(actionEvent);
}
});
jButton1.setBounds(new Rectangle(116, 351, 75, 29));
jButton1.setText("关闭");
jButton1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
jButton1_actionPerformed(actionEvent);
}
});
jPanel1.setBounds(new Rectangle(333, 204, 148, 186));
jPanel1.setLayout(null);
jLabel1.setBounds(new Rectangle(25, 18, 100, 118));
jLabel2.setText("对方形象");
jLabel2.setBounds(new Rectangle(52, 143, 75, 18));
jLabel3.setText("对方信息");
jLabel3.setBounds(new Rectangle(52, 163, 74, 19));
jToolBar1.setBackground(UIManager.getColor(
"InternalFrame.activeTitleGradient"));
jToolBar1.setBounds(new Rectangle(3, 246, 324, 23));
jToolBar2.setBackground(UIManager.getColor("TextArea.selectionBackground"));
jToolBar2.setBounds(new Rectangle(333, 186, 148, 18));
jToggleButton1.setToolTipText("");
jToggleButton1.setText("字体");
jToggleButton1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
jToggleButton1_actionPerformed(actionEvent);
}
});
jToolBar3.setBackground(UIManager.getColor(
"InternalFrame.activeTitleGradient"));
jToolBar3.setBounds(new Rectangle(3, 0, 325, 23));
jToggleButton2.setText("查看好友资料");
jToolBar4.setBounds(new Rectangle(331, 0, 151, 21));
this.getContentPane().add(jTextPane2);
this.getContentPane().add(jTextPane1);
this.getContentPane().add(jButton1);
this.getContentPane().add(jButton2);
this.getContentPane().add(jPanel1);
jPanel1.add(jLabel3);
this.getContentPane().add(jPanel2);
this.getContentPane().add(jToolBar1);
jToolBar1.add(jToggleButton1);
this.getContentPane().add(jToolBar2);
this.getContentPane().add(jToolBar3);
this.getContentPane().add(jToolBar4);
jToolBar3.add(jToggleButton2);
jPanel2.add(jLabel1);
jPanel2.add(jLabel2);
jTextPane2.setBounds(new Rectangle(3, 269, 324, 71));
this.setSize(500,420);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
}
public static void main(String[] agrs){
new Frame1("QQ");
}
public void jButton1_actionPerformed(ActionEvent actionEvent) {
}
public void jButton2_actionPerformed(ActionEvent actionEvent) {
}
public void jToggleButton1_actionPerformed(ActionEvent actionEvent) {
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -