# How to change background Color of Popup Menu

**URL:** <https://forum.inductiveautomation.com/t/how-to-change-background-color-of-popup-menu/34685>\
**Category:** Ignition\
**Created:** [May 13, 2020, 2:55am UTC](https://forum.inductiveautomation.com/t/how-to-change-background-color-of-popup-menu/34685 "2020-05-13T02:55:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhargava](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@abhargava](https://forum.inductiveautomation.com/u/abhargava)\
**Post date:** [May 13, 2020, 2:55am UTC](https://forum.inductiveautomation.com/t/how-to-change-background-color-of-popup-menu/34685/1 "2020-05-13T02:55:59Z")

</div>

we are trying to change the background color of Popup menu by using the following script:

```auto
import system
	if system.tag.readBlocking(['[System]Client/System/SystemFlags'])[0].value > 3:

		from javax.swing import JMenuItem
		from javax.swing.border import EmptyBorder
		
		def doMenuItem1(event):
			import system
			system.gui.messageBox("Report 1 selected")
		def doMenuItem2(event):
			import system
			system.gui.messageBox("Report 2 selected")
		def doMenuItem3(event):
			import system
			system.gui.messageBox("Report 3 selected")
		
		import system
		
		menu = system.gui.createPopupMenu([],[])
		
		
		menuitem1 = JMenuItem ("Report 1",actionPerformed=doMenuItem1)
		menuitem1.selectionBackground = system.gui.color(255,0,0)
		menuitem1.foreground = system.gui.color(0,0,0)
		menu.add(menuitem1)
		
		menuitem2 = JMenuItem ("Report 2",actionPerformed=doMenuItem2)
		menuitem2.background = system.gui.color(255,0,0)
		menuitem2.foreground = system.gui.color(0,0,0)
		menu.add(menuitem2)
		
		menu.addSeparator()
		
		menuitem3 = JMenuItem ("Report 3",actionPerformed=doMenuItem3)
		menuitem3.background = system.gui.color(255,0,0)
		menuitem3.foreground = system.gui.color(0,0,0)
		menu.add(menuitem3)
		
		
		menu.setPopupSize(150, 25*3)
		menu.setBackground(system.gui.color(255,0,0))
		
		menu.show(event,event.source.parent.x,event.source.parent.y+25)

```

This code has been written on Power Table’s onPopupTrigger Extension function using Ignition v8.0.7

we were trying to set the background to red but we still get the default color

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [May 13, 2020, 4:35pm UTC](https://forum.inductiveautomation.com/t/how-to-change-background-color-of-popup-menu/34685/2 "2020-05-13T16:35:32Z")

</div>

There is a bug ticket for this, but it not have a high priority...as it's only a GUI concern

> [@\[bug-13063\]Color of Jmenu items in Ignition 8](http://forum.inductiveautomation.com/t/bug-13063-color-of-jmenu-items-in-ignition-8/25201/8):
>
> @Paul.Scott, @PGriffith Any evolution in the backlog for this ticket…or a workaround ?

---

<div class="post-metadata">

**Author:** ![abhargava](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@abhargava](https://forum.inductiveautomation.com/u/abhargava)\
**Post date:** [May 14, 2020, 4:14am UTC](https://forum.inductiveautomation.com/t/how-to-change-background-color-of-popup-menu/34685/3 "2020-05-14T04:14:02Z")

</div>

I guess we can’t do anything about it for now.  
but it would be helpful if we are able to solve it soon as we have to use this in one of our projects.

Thank you for the reply @mazeyrat
