Hello there,
I am not sure if I’m doing something wrong here, however it seems that UIManager doesn’t seem to work for me.
I am trying to change the background color of the JOptionPane to customize how the message boxes look a little bit.
This is what I have so far:
from java.awt import Color
from javax.swing import ImageIcon
from javax.swing import JLabel
from javax.swing import JOptionPane
from javax.swing import JPanel
from javax.swing import SwingConstants
from javax.swing import UIManager
def Message(message = ''):
UIManager.put('OptionPane.background', Color.red)
UIManager.put("Panel.background", Color.red)
panel = JPanel()
panel.add(JLabel(ImageIcon("D:\Ignition Library\SweetAlert\Success.gif")))
JOptionPane.showConfirmDialog(None, panel, None, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE)
This is a script that can be called via Alert.Message()
Everything is showing as expected, however the background is always the same as default.
I’ve also tried putting the UI manager code in a client event script on startup, however it doesn’t seem to take effect.
Any ideas?