2022-10-20 12:49:09 +02:00
|
|
|
import javax.swing.JFrame;
|
2022-10-26 11:13:11 +02:00
|
|
|
import java.awt.*;
|
2022-10-20 12:49:09 +02:00
|
|
|
/**
|
|
|
|
* Luminance
|
|
|
|
*/
|
|
|
|
public class Luminance {
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
JFrame f = new JFrame();
|
|
|
|
|
|
|
|
LumPanel lm = new LumPanel();
|
|
|
|
lm.setLocation(0, 0);
|
|
|
|
lm.setSize(480, 100);
|
|
|
|
|
|
|
|
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
|
f.setLocation(200, 200);
|
|
|
|
f.setSize(400, 100);
|
|
|
|
f.setResizable(false);
|
|
|
|
f.add(lm);
|
|
|
|
f.setLayout(null);
|
|
|
|
f.setVisible(true);
|
|
|
|
|
|
|
|
lm.addMouseListener(new LumListener());
|
2022-10-26 11:13:11 +02:00
|
|
|
|
|
|
|
while (true) {
|
|
|
|
Point p = MouseInfo.getPointerInfo().getLocation();
|
|
|
|
lm.setMCoords(p.x - lm.getLocationOnScreen().x, p.y - lm.getLocationOnScreen().y);
|
|
|
|
}
|
2022-10-20 12:49:09 +02:00
|
|
|
}
|
|
|
|
}
|