Using Java classes within Python

The Python terminal is built on top of the INTViewer Java API, which itself is built on top Java. As a result, you can access Java classes using the "import" command.

Here is an example on how to open a file dialog in the Python terminal, leveraging the Java API. This example asks the user for a directory path.

from javax.swing import JFileChooser
chooser = JFileChooser()
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY)
resp = chooser.showDialog(None, "Choose a Directory")
print chooser.getSelectedFile()

The full API of JFileChooser in Java is described here:

http://docs.oracle.com/javase/8/docs/api/javax/swing/JFileChooser.html