Java实现Swing组件定制Button示例-创新互联
本文实例讲述了Java实现Swing组件定制Button。分享给大家供大家参考,具体如下:
创新互联建站是一家专注于做网站、
网站建设与策划设计,丹江口网站建设哪家好?
创新互联建站做网站,专注于网站建设10多年,网设计领域的专业建站公司;建站业务涵盖:丹江口等地区。丹江口做网站价格咨询:18980820575
先来看看运行效果图:
具体代码如下:
package themedemo;
import java.awt.BasicStroke;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.GridLayout;
import java.awt.RenderingHints;
import java.util.Map;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.Painter;
import javax.swing.SwingUtilities;
import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.WindowConstants;
public class ButtonSkinDemo {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
for (UIManager.LookAndFeelInfo laf : UIManager
.getInstalledLookAndFeels()) {
if ("Nimbus".equals(laf.getName())) {
try {
UIManager.setLookAndFeel(laf.getClassName());
} catch (Exception e) {
e.printStackTrace();
}
}
}
for (Map.Entry
分享文章:Java实现Swing组件定制Button示例-创新互联
当前地址:
http://azwzsj.com/article/jjcco.html