1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
| package io.github.lete114.tools;
import javax.swing.*; import java.awt.*; import java.util.Timer; import java.util.TimerTask;
public class XY extends JFrame { private final JPanel contentPanel = new JPanel();
JLabel vx = null; JLabel vy = null; JLabel r = null; JLabel g = null; JLabel b = null; JLabel h = null;
public XY() {
getContentPane().add(contentPanel, BorderLayout.CENTER); contentPanel.setLayout(null);
setIconImage(Toolkit.getDefaultToolkit().createImage(getClass().getResource("lete.jpg")));
JLabel lblx = new JLabel("\u5750\u6807X:"); lblx.setFont(new Font("黑体", Font.PLAIN, 30)); lblx.setBounds(70, 30, 100, 30); contentPanel.add(lblx); JLabel lbly = new JLabel("\u5750\u6807Y:"); lbly.setFont(new Font("黑体", Font.PLAIN, 30)); lbly.setBounds(270, 30, 100, 30); contentPanel.add(lbly);
vx = new JLabel("0"); vx.setForeground(Color.BLUE); vx.setFont(new Font("黑体", Font.PLAIN, 30)); vx.setBounds(160, 30, 66, 31); contentPanel.add(vx);
vy = new JLabel("0"); vy.setForeground(Color.BLUE); vy.setFont(new Font("黑体", Font.PLAIN, 30)); vy.setBounds(360, 30, 66, 30); contentPanel.add(vy);
r = new JLabel("0"); r.setForeground(Color.BLUE); r.setFont(new Font("黑体", Font.PLAIN, 30)); r.setBounds(120, 80, 66, 31); contentPanel.add(r); JLabel hong = new JLabel("红:"); hong.setFont(new Font("黑体", Font.PLAIN, 30)); hong.setForeground(Color.RED); hong.setBounds(70, 80, 100, 30); contentPanel.add(hong);
g = new JLabel("0"); g.setForeground(Color.BLUE); g.setFont(new Font("黑体", Font.PLAIN, 30)); g.setBounds(120, 130, 66, 31); contentPanel.add(g); JLabel lv = new JLabel("绿:"); lv.setFont(new Font("黑体", Font.PLAIN, 30)); lv.setForeground(Color.green); lv.setBounds(70, 130, 100, 30); contentPanel.add(lv);
b = new JLabel("0"); b.setForeground(Color.BLUE); b.setFont(new Font("黑体", Font.PLAIN, 30)); b.setBounds(120, 170, 66, 30); contentPanel.add(b); JLabel lan = new JLabel("蓝:"); lan.setFont(new Font("黑体", Font.PLAIN, 30)); lan.setForeground(Color.blue); lan.setBounds(70, 170, 100, 30); contentPanel.add(lan);
h = new JLabel(""); h.setForeground(Color.BLUE); h.setFont(new Font("黑体", Font.PLAIN, 30)); h.setBounds(290, 130, 500, 30); contentPanel.add(h); JLabel hexz = new JLabel("HEX值:"); hexz.setFont(new Font("黑体", Font.PLAIN, 30)); hexz.setBounds(200, 130, 100, 30); contentPanel.add(hexz);
JLabel ms1 = new JLabel("此工具纯属个人兴趣爱好,本人常用到该功能"); JLabel ms2 = new JLabel(" 于是就写了这个工具"); JLabel ms3 = new JLabel(" 请不要用于商业用途"); JLabel ms4 = new JLabel(" 一切后果自己负责"); JLabel ms5 = new JLabel(" --乐特"); ms1.setFont(new Font("黑体", Font.PLAIN, 20)); ms2.setFont(new Font("黑体", Font.PLAIN, 20)); ms3.setFont(new Font("黑体", Font.PLAIN, 20)); ms4.setFont(new Font("黑体", Font.PLAIN, 20)); ms5.setFont(new Font("黑体", Font.PLAIN, 25)); ms1.setForeground(Color.RED); ms2.setForeground(Color.RED); ms3.setForeground(Color.RED); ms4.setForeground(Color.RED); ms5.setForeground(Color.black); ms1.setBounds(50, 240, 3000, 30); ms2.setBounds(50, 260, 3000, 30); ms3.setBounds(50, 280, 3000, 30); ms4.setBounds(50, 300, 3000, 30); ms5.setBounds(50, 320, 3000, 30); contentPanel.add(ms1); contentPanel.add(ms2); contentPanel.add(ms3); contentPanel.add(ms4); contentPanel.add(ms5); } }
|