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

📄 imagelabel.java

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


import java.awt.Dimension;
import java.net.MalformedURLException;
import java.net.URL;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;

public class ImageLabel extends JLabel {
	
	public ImageLabel(String iconFile) {
		super("");
		try {
			this.setIcon(new ImageIcon(new URL(HtmlToolBar.imagepath.concat(iconFile))));
		} catch (MalformedURLException e) {
			e.printStackTrace();
		}
		init();
	}
	
	public ImageLabel(Icon icon) {
		super("");
		this.setIcon(icon);
		init();
	}
	
	private void init() {
		Dimension d = new Dimension(this.getIcon().getIconWidth(), this.getIcon().getIconHeight());
		this.setSize(d);
		this.setPreferredSize(d);
		this.setBorder(null);
	}

}

⌨️ 快捷键说明

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