toolspanel.java

来自「本代码是基于J2EE的一个简单QQ聊天程序 其功能实现表情 即时消息 在线发布订」· Java 代码 · 共 68 行

JAVA
68
字号
package qq.client.panel;import java.awt.Color;import java.awt.Dimension;import java.awt.FlowLayout;import java.awt.Insets;import javax.swing.*;import javax.swing.border.Border;/** * @author haizhou * 选择表情,设置字体 */public class ToolsPanel extends JPanel{	private static final long serialVersionUID = 1552162L;	private JButton face;	private JButton font;	private JButton color;	public ToolsPanel(){		this.setLayout(new FlowLayout(FlowLayout.LEADING,20,2));		this.setBackground(new Color(244, 249, 254));		Border line = BorderFactory.createLineBorder(new Color(74,133, 213));		this.setBorder(line);		ImageIcon icon=new ImageIcon("qq/images/image/font.gif");		font=new JButton(icon);		font.setBorderPainted(false);		font.setFocusPainted(false);		font.setMargin(new Insets(0,0,0,0));		font.setActionCommand("字体");				icon=new ImageIcon("qq/images/image/color.gif");		color=new JButton(icon);		color.setBorderPainted(false);		color.setFocusPainted(false);		color.setMargin(new Insets(0,0,0,0));		color.setActionCommand("颜色");				icon=new ImageIcon("qq/images/image/face.gif");		face=new JButton(icon);		face=new JButton(icon);		face.setBorderPainted(false);		face.setFocusPainted(false);		face.setMargin(new Insets(0,0,0,0));		face.setActionCommand("表情");				this.add(font);		this.add(color);		this.add(face);		this.setSize(new Dimension(5,5));	}	public JButton getColorButton() {		return color;	}	public JButton getFaceButton() {		return face;	}	public JButton getFontButton() {		return font;	}	}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?