⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 htmltoolbar1.java

📁 可实现超链接等功能强大的编辑器
💻 JAVA
字号:
package com.cwq.htmltoolbar;


import java.awt.ComponentOrientation;
import java.awt.GridBagLayout;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.io.File;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.text.MutableAttributeSet;

public class HtmlToolbar1 extends JPanel {

	private static final long serialVersionUID = 1L;
	
	private HtmlToolBar app;

	/**
	 * This is the default constructor
	 */
	public HtmlToolbar1(HtmlToolBar app) {
		super();
		this.app = app;
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(300, 200);
		
		this.setLayout(null);
		this.setBounds(new Rectangle(12, 6, 625, 22));
		this.setBorder(null);
		this.setBackground(app.color1);
		this.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
		
		
		JLabel jl1 = new ImageButton("b.gif", null, "b_1.gif") {
			public void mouseClicked(MouseEvent arg0) {
				app.insertTag("<strong>", "</strong>");
			}
		};
		jl1.setLocation(0, 1);
		this.add(jl1);

		JLabel jl2 = new ImageButton("i.gif", null, "i_1.gif") {
			public void mouseClicked(MouseEvent arg0) {
				app.insertTag("<em>", "</em>");
			}
		};
		jl2.setLocation(jl2.getWidth() - 2, 1);
		this.add(jl2);
		
		JLabel jl3 = new ImageLabel("split.gif");
		jl3.setLocation(jl2.getLocation().x + jl2.getWidth() - 2, 0);
		this.add(jl3);
		
		JLabel jl4 = new ImageButton("link.gif", null, "link_1.gif") {
			public void mouseClicked(MouseEvent arg0) {
				String link = javax.swing.JOptionPane.showInputDialog(app, "锟斤拷锟斤拷锟斤拷t锟借

⌨️ 快捷键说明

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