June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -13,6 +13,7 @@ class KeyboardMacroDemo {
|
|||
+"<b>Ctrl-H</b> to hide it</html>";
|
||||
|
||||
frame.add( new JLabel(directions));
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
frame.addKeyListener( new KeyAdapter(){
|
||||
public void keyReleased( KeyEvent e ) {
|
||||
|
|
|
|||
25
Task/Keyboard-macros/Kotlin/keyboard-macros.kotlin
Normal file
25
Task/Keyboard-macros/Kotlin/keyboard-macros.kotlin
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
// version 1.2.31
|
||||
|
||||
import javax.swing.JFrame
|
||||
import javax.swing.JLabel
|
||||
import java.awt.event.KeyAdapter
|
||||
import java.awt.event.KeyEvent
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val directions = "<html><b>Ctrl-S</b> to show frame title<br>" +
|
||||
"<b>Ctrl-H</b> to hide it</html>"
|
||||
with (JFrame()) {
|
||||
add(JLabel(directions))
|
||||
defaultCloseOperation = JFrame.EXIT_ON_CLOSE
|
||||
addKeyListener(object : KeyAdapter() {
|
||||
override fun keyReleased(e: KeyEvent) {
|
||||
if (e.isControlDown() && e.keyCode == KeyEvent.VK_S)
|
||||
title = "Hello there"
|
||||
else if( e.isControlDown() && e.keyCode == KeyEvent.VK_H)
|
||||
title = ""
|
||||
}
|
||||
})
|
||||
pack()
|
||||
isVisible = true
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue