UIManager problem

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?

If you are trying to accomplish that in perspective, you may want to look at this thread that deals with more swing controller action- of a different sort
(add an h to your URL browser- did not want first part of message, just answers 4-8)
ttps://forum.inductiveautomation.com/t/pdf-viewer-event-handlers/26795
This goes back to event handlers. If there is still an issue ( maybe get/put? ) then:
https://support.inductiveautomation.com and consider reading the support policies first. I hope this helps you more than it did one other…

Sadly I’m doing this in Vision, not perspective.

I appreciate the quick responss