Last active
March 10, 2019 12:22
-
-
Save ezhov-da/ec40041bf28786524eb21a983871a305 to your computer and use it in GitHub Desktop.
java key finger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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