# system.file.openFile change/increase font size

**URL:** <https://forum.inductiveautomation.com/t/system-file-openfile-change-increase-font-size/18093>\
**Category:** Ignition\
**Created:** [May 19, 2018, 7:37am UTC](https://forum.inductiveautomation.com/t/system-file-openfile-change-increase-font-size/18093 "2018-05-19T07:37:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [May 19, 2018, 7:37am UTC](https://forum.inductiveautomation.com/t/system-file-openfile-change-increase-font-size/18093/1 "2018-05-19T07:37:43Z")

</div>

Is it possible to change/increase font size in system.file.openFile dialog?  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/c9ea10cc3d0e779b482e94d1845b1c7a8eac3074.PNG)  
On the touch screens with 1920x1080 resolution the directories are very small and it hard to select them with fingers…

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [May 21, 2018, 1:46pm UTC](https://forum.inductiveautomation.com/t/system-file-openfile-change-increase-font-size/18093/2 "2018-05-21T13:46:11Z")

</div>

Bump… 👋 …

---

<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:** [May 21, 2018, 3:13pm UTC](https://forum.inductiveautomation.com/t/system-file-openfile-change-increase-font-size/18093/3 "2018-05-21T15:13:01Z")

</div>

Unfortunately, there’s no great way to adjust the size of the components - all the file dialogs in Ignition are instances of the [`JFileChooser`](https://docs.oracle.com/javase/7/docs/api/javax/swing/JFileChooser.html) class - and as you can see here, while it’s possible to drill into its components and adjust font sizing, it’s not a trivial thing to do: [https://stackoverflow.com/a/18771331](https://stackoverflow.com/a/18771331)

Complicating things further, all scripting events happen on the event dispatch thread, which is interrupted by any modal dialogs in Ignition - including the JFileChooser - so you won’t (easily) be able to access the file chooser through scripting.

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [May 21, 2018, 4:15pm UTC](https://forum.inductiveautomation.com/t/system-file-openfile-change-increase-font-size/18093/4 "2018-05-21T16:15:46Z")

</div>

This is what I came up with (in button actionPerformed event):

```auto
from javax.swing import JList
from javax.swing import JTable
from javax.swing import JFileChooser
from javax.swing import filechooser
from javax.swing import UIManager
from javax.swing import SwingUtilities
#from javax.swing.plaf import FontUIResource
#from java.awt import Font
from java.awt import Component
from java.awt import Container
from java.awt import Dimension
from java.io import FileFilter
from javax.swing.filechooser import FileNameExtensionFilter

#start in this folder
chooser = JFileChooser("C:\\OMG\\BenderOne")
jezik =system.util.getLocale() 
#print "Language=", jezik
#if selected language is Slovenian, set Slovenian text for all labels, buttons, tooltips...
if jezik == "sl":
	UIManager.put("FileChooser.openDialogTitleText", u"Izberi šifro")
	UIManager.put("FileChooser.lookInLabelText", "Poglej v:")
	UIManager.put("FileChooser.saveInLabelText", "Shrani v:")
	UIManager.put("FileChooser.openButtonText", "Izberi mapo")
	UIManager.put("FileChooser.saveButtonText", "Shrani")
	UIManager.put("FileChooser.cancelButtonText", "Prekini")
	UIManager.put("FileChooser.fileNameLabelText", "Ime datoteke:")
	UIManager.put("FileChooser.filesOfTypeLabelText", "Tip datoteke:")
	UIManager.put("FileChooser.openButtonToolTipText", u"Izberi izbrano šifro")
	UIManager.put("FileChooser.saveButtonToolTipText", "Shrani izbrano datoteko")
	UIManager.put("FileChooser.cancelButtonToolTipText","Prekini")
	UIManager.put("FileChooser.fileNameHeaderText","Ime Datoteke:")
	UIManager.put("FileChooser.upFolderToolTipText", u"Nivo višje")
	UIManager.put("FileChooser.homeFolderToolTipText","Namizje")
	UIManager.put("FileChooser.newFolderToolTipText","Naredi novo mapo")
	UIManager.put("FileChooser.listViewButtonToolTipText","List")
	UIManager.put("FileChooser.newFolderButtonText","Naredi novo mapo")
	UIManager.put("FileChooser.renameFileButtonText", "Preimenuj datoteko")
	UIManager.put("FileChooser.deleteFileButtonText", "Izbriši datoteko")
	UIManager.put("FileChooser.filterLabelText", "Tip Datoteke:")
	UIManager.put("FileChooser.detailsViewButtonToolTipText", "Podrobnosti")
	UIManager.put("FileChooser.fileSizeHeaderText","Velikost")
	UIManager.put("FileChooser.fileDateHeaderText", "Spremenjeno")
	SwingUtilities.updateComponentTreeUI(chooser)

#function for changing the font size for everything except icons in top right corner
def setFileChooserFont(comp):
	for x in range (0, len(comp)):
		#recursive
		if isinstance(comp[x],Container): 
			setFileChooserFont(comp[x].getComponents())
		
		try:
			#if isinstance(comp[x],JList) or isinstance(comp[x],JTable):
				comp[x].setFont(comp[x].getFont().deriveFont(comp[x].getFont().getSize() * 2.0))
		except ValueError:
			print ValueError #do nothing
		except AttributeError:
			print AttributeError #do nothing

setFileChooserFont(chooser.getComponents())  

#Allow user to choose only folder
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)
chooser.setAcceptAllFileFilterUsed(False)
#chooser.setDialogTitle(u"Izberite Mapo")
# only allow files of .xml extension
restrict = FileNameExtensionFilter("xml files (.xml, .xmls)", ["xml","xmls"])
chooser.addChoosableFileFilter(restrict)
#set size of the FileOpen dialog
chooser.setPreferredSize(Dimension(800,500))
#set text for the OK/Open button
#chooser.setApproveButtonText("Select Dir")
filepath = ""

if chooser.showOpenDialog(event.source.parent) == JFileChooser.APPROVE_OPTION:
	filepath = str(chooser.getSelectedFile())
	event.source.parent.getComponent('Label 2').text = filepath
	event.source.parent.getComponent('Label 3').text = filepath + "\project.xml"

```

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/c6c048b2ca1a1ac96c0a69ae0a972900f34c5abd.PNG)

Now you can select with fat fingers also… 👆😀
