Anonymous user
GUI/Maximum window dimensions: Difference between revisions
→{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details
(Added Kotlin) |
(→{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details) |
||
Line 411:
=={{header|Kotlin}}==
{{trans|Java}}
<lang scala>// version 1.
import java.awt.
import javax.swing.JFrame
Line 422:
val screenSize = toolkit.screenSize
println("Physical screen size : ${formatOutput(screenSize, r)}")
val insets = toolkit.getScreenInsets(graphicsConfiguration)
println("Insets : ${formatOutput(insets, r)}")
screenSize.width -= (insets.left + insets.right)
screenSize.height -= (insets.top + insets.bottom)
println("Max available : ${formatOutput(screenSize, r)}")
}
|