package com.http; import java.awt.*; import javax.swing.*; public class TestSwing2 { //创建了一个能够绘制的组件 class HelloWorldComponent extends JComponent { public static final int MESSAGE_X = 75; public static final int MESSAGE_Y = 100; private static final i…
import javax.swing.*; import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.InputEvent; public class SwingComponent { JFrame f = new JFrame("test"); Icon okIcon = new ImageIcon("ico/ok.png"); JButton ok = new J…
一般有一个默认名字 但是具体运行到哪一个线程,需要猜 为了节约时间,提高效率 可以给线程写个中文名(因为默认就是英文,写中文,一眼就能挑出来) 以RTC定时器为例子 final TimerRtc timerRtc = new TimerRtc(1000, new ActionListener() { public void actionPerformed(ActionEvent e) { new Thread("rtc实时时钟") { @Override public void run…