Mercurial Hosting > luan
diff src/luan/modules/swing/Swing.luan @ 1917:f5f4c79d375f
1 process
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Fri, 18 Apr 2025 19:17:23 -0600 |
| parents | 15dda75a887f |
| children | e2d69cfe1b3c |
line wrap: on
line diff
--- a/src/luan/modules/swing/Swing.luan Thu Apr 17 23:27:42 2025 -0600 +++ b/src/luan/modules/swing/Swing.luan Fri Apr 18 19:17:23 2025 -0600 @@ -6,6 +6,7 @@ local URI = require "java:java.net.URI" local Insets = require "java:java.awt.Insets" local Desktop = require "java:java.awt.Desktop" +local Window = require "java:java.awt.Window" local UIManager = require "java:javax.swing.UIManager" local FlatLightLaf = require "java:com.formdev.flatlaf.FlatLightLaf" local SwingLuan = require "java:luan.modules.swing.SwingLuan" @@ -34,6 +35,7 @@ Swing.set_look_and_feel = UIManager.setLookAndFeel Swing.run = SwingLuan.run +Swing.run_later = SwingLuan.runLater Swing.new_insets = Insets.new -- top, left, bottom, right Swing.no_insets = Insets.new(0,0,0,0) @@ -46,4 +48,11 @@ Swing.home_dir = System.getProperty("user.home") +function Swing.to_front() + local windows = {Window.getOwnerlessWindows()} + for _, window in ipairs(windows) do + window.toFront() + end +end + return Swing
