Thomas
01/02/2021, 10:31 AMinvokeLater {
JFrame.setDefaultLookAndFeelDecorated(true)
and later in a composable:
val window = AppManager.windows.first().window
getDefaults()["activeCaption"] =
ColorUIResource(colors.background.toArgb())
getDefaults()["activeCaptionText"] =
ColorUIResource(colors.primary.toArgb())
window.rootPane.windowDecorationStyle = JRootPane.FRAME
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName())
SwingUtilities.updateComponentTreeUI(window.rootPane)
Please note that I need to set the look and feel, because deep inside Compose (org.jetbrains.skiko.Library
) it apparently (decompiled code) is initialized as:
private final void miscSystemInit() {
System.setProperty("sun.awt.noerasebackground", "true");
System.setProperty("skija.staticLoad", "false");
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
System.setProperty("apple.laf.useScreenMenuBar", "true");
} catch (UnsupportedOperationException var2) {
}
}
The best thing would be to have a Swing Look and Feel that fits the Material Design look alike, at least for window decoration and menubars inside a window. And we might need the ability to have the client app specify a look and feel and pass it there...Thomas
01/02/2021, 12:15 PMKirill Grouchnikov
01/02/2021, 2:42 PMKirill Grouchnikov
01/02/2021, 2:49 PMBig Chungus
01/02/2021, 3:26 PMKirill Grouchnikov
01/02/2021, 4:10 PMBig Chungus
01/02/2021, 4:12 PMKirill Grouchnikov
01/02/2021, 4:27 PMThomas
01/02/2021, 6:08 PMKirill Grouchnikov
01/02/2021, 6:11 PMKirill Grouchnikov
01/02/2021, 6:12 PMKirill Grouchnikov
01/02/2021, 6:14 PMKirill Grouchnikov
01/02/2021, 6:15 PMThomas
01/02/2021, 6:16 PMThomas
01/02/2021, 6:18 PMKirill Grouchnikov
01/02/2021, 6:18 PMKirill Grouchnikov
01/02/2021, 6:24 PMKirill Grouchnikov
01/02/2021, 6:26 PMThomas
01/02/2021, 6:28 PMKirill Grouchnikov
01/02/2021, 10:37 PMThomas
01/03/2021, 8:34 AM