ledclockwindow.java
来自「一个巨型LCD数字电子时钟」· Java 代码 · 共 42 行
JAVA
42 行
import java.awt.*;import java.awt.event.*;import javax.swing.*;//Fu Bin MSN:yonghe169@163.com public class LedClockWindow extends JFrame{ private Container container = getContentPane(); private LedClockPanel ledClockPanel = new LedClockPanel(); public static int setCoordinateX; public static int setCoordinateY; private WindowLocationUpdate windowLocationUpdate = new WindowLocationUpdate(); public static boolean windowMustBeShown; public static boolean windowMustMinimized; private Image ledClockIcon; private class WindowLocationUpdate extends Thread{ public void run(){ while(true){ setLocation(setCoordinateX,setCoordinateY); if (windowMustBeShown == true){ show(); windowMustBeShown = false; } if (windowMustMinimized == true){ setState(JFrame.ICONIFIED); windowMustMinimized = false; } try{Thread.sleep(10);} catch(InterruptedException e){} } } } public LedClockWindow(String windowTitle){ super(windowTitle); ledClockIcon = new ImageIcon(LedClockIcon.ledClockIcon).getImage(); setIconImage(ledClockIcon); setUndecorated(true); container.add(ledClockPanel,BorderLayout.CENTER); pack(); windowLocationUpdate.start(); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?