Skip to content

Instantly share code, notes, and snippets.

@ezhov-da
Last active March 10, 2019 12:22
Show Gist options
  • Save ezhov-da/ec40041bf28786524eb21a983871a305 to your computer and use it in GitHub Desktop.
Save ezhov-da/ec40041bf28786524eb21a983871a305 to your computer and use it in GitHub Desktop.
java key finger
[code:]java[:code]package ru.ezhov.keyFingger;
import javax.swing.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
/**
* Created by ezhov_da on 05.10.2017.
*/
public class App {
public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
JDialog frame = new JDialog();
JLabel label = new JLabel(new ImageIcon(App.class.getResource("/key.png")));
frame.add(label);
frame.pack();
frame.setResizable(false);
frame.setLocationRelativeTo(null);
frame.setAlwaysOnTop(true);
frame.setVisible(true);
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
frame.dispose();
System.exit(0);
}
});
});
}
}
[/code]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment