Mercurial Hosting > luan
changeset 1889:0d11447423a2 default tip
use NimbusLookAndFeel
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 10 Apr 2025 18:48:50 -0600 |
parents | a28e22991c58 |
children | |
files | src/luan/modules/swing/Component.luan src/luan/modules/swing/SwingLuan.java |
diffstat | 2 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/luan/modules/swing/Component.luan Thu Apr 10 11:41:02 2025 -0600 +++ b/src/luan/modules/swing/Component.luan Thu Apr 10 18:48:50 2025 -0600 @@ -73,6 +73,8 @@ if border~=nil then jcomponent.setBorder(border) end local foreground_color = delete(props,"foreground_color") if foreground_color~=nil then jcomponent.setForeground(foreground_color) end + local background_color = delete(props,"background_color") + if background_color~=nil then jcomponent.setBackground(background_color) end local alignment_x = delete(props,"alignment_x") if alignment_x~=nil then alignment_x = alignments[alignment_x] or error "invalid alignment_x"
--- a/src/luan/modules/swing/SwingLuan.java Thu Apr 10 11:41:02 2025 -0600 +++ b/src/luan/modules/swing/SwingLuan.java Thu Apr 10 18:48:50 2025 -0600 @@ -11,6 +11,7 @@ import javax.swing.text.JTextComponent; import javax.swing.text.Document; import javax.swing.undo.UndoManager; +import java.awt.Color; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.event.WindowListener; @@ -36,12 +37,14 @@ for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { logger.info(info.toString()); } +*/ + UIManager.put("control",new Color(0xedeff2)); try { //UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); //UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); - //UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel"); + UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel"); //UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel"); - UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); + //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch(ClassNotFoundException e) { throw new RuntimeException(e); } catch(InstantiationException e) { @@ -51,7 +54,6 @@ } catch(UnsupportedLookAndFeelException e) { throw new RuntimeException(e); } -*/ } private static void exception(LuanException e) {