# How to change Windows Bar at top of Example Project?

**URL:** <https://forum.inductiveautomation.com/t/how-to-change-windows-bar-at-top-of-example-project/2409>\
**Category:** Ignition\
**Created:** [December 9, 2010, 8:32pm UTC](https://forum.inductiveautomation.com/t/how-to-change-windows-bar-at-top-of-example-project/2409 "2010-12-09T20:32:40Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 1, 2017, 5:04pm UTC](https://forum.inductiveautomation.com/t/how-to-change-windows-bar-at-top-of-example-project/2409/8 "2017-11-01T17:04:54Z")

</div>

Automatic dropdown navigation menu (only adds folders one level deep):

```auto
from javax.swing import SwingUtilities, JMenu, JMenuBar, JMenuItem
from functools import partial

window = system.nav.getWindow("somewindow")
root = SwingUtilities.getRoot(window)
menu = root.getJMenuBar()	

navmenu = JMenu("Navigation");

def handleSelect(event, target):
	system.nav.swapTo(target)

trees = {}
leaves = []

for window in system.gui.getWindowNames():
	winsplit = window.split('/')
	if winsplit[0] != 'Nav':
	
		menuItem = JMenuItem(winsplit[-1], actionPerformed=partial(handleSelect, target=window))
		if len(winsplit) > 1:
			if trees.get(winsplit[0]) is not None:
				trees[winsplit[0]].add(menuItem)
			else:
				submenu = JMenu(winsplit[0])
				submenu.add(menuItem)
				trees[winsplit[0]] = submenu
		else:
			leaves.append(JMenuItem(window, actionPerformed=partial(handleSelect, target=window)))
		
for tree in trees:
	navmenu.add(trees[tree])
	
for leaf in leaves:
	navmenu.add(leaf)

menu.add(navmenu)

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-to-change-windows-bar-at-top-of-example-project/2409)._
