IDE

The GUI window

Some programs do not only print. They draw: a matplotlib chart, a turtle drawing, a tkinter or Swing window, a pygame sketch. JDoodle gives those programs a screen and shows it to you in the GUI tab, live, while the program runs.

The window is not a picture of the result. It is the real window, so you can click the buttons, type into the fields, drag the matplotlib toolbar and zoom into your chart, exactly as you would on your own machine.

Turn it on

The GUI window is off by default. Tick GUI in the I/O row, above your input box, before you press Execute.

Ticking GUI also turns Interactive on. A window needs a live connection to your program, and that is what Interactive gives it.

Leave GUI off for programs that only print. Starting a screen makes every run wait for it, so a program that never draws finishes faster without it.

What happens when you run

Your program runs as it always does, and Output still shows everything it prints. The GUI tab is extra, not a replacement.

The moment your program opens a window, the GUI tab lights up and shows it. If your program never opens one, nothing changes and no window appears.

There is a Full screen button above the window if you want it bigger. The countdown stays visible so you can see how long you have left.

Languages that can show a window

A window is available for these languages, on their newest version:

C, C++, C++ 14, C++ 17, C++ 20, C++ 23, C99, Clojure, FreeBASIC, Groovy, Java, Kotlin, Perl, PyPy3, Python 3, R, Rhino JS, Ruby, Scala and Tcl.

The GUI tab always names the current list, so check there rather than here if you are unsure - we add languages over time.

Two things decide whether you get a window: the language, and the version you have selected. The screen lives in the newest image for each language, so an older version of a language that otherwise supports it will not draw. If you pick one, the IDE tells you which version to switch to.

Some languages need their drawing library added in Libs first, the same as any other library. Every C and C++ dialect is the same compiler underneath, so they all take the same entry:

  • C and C99 - add X11 to draw with Xlib
  • C++, C++ 14, C++ 17, C++ 20 and C++ 23 - add SDL2
  • Ruby - add tk to use Ruby/Tk

Those entries live in the Advanced editor, which is where the Libraries panel is.

If your language cannot show a window at all, the GUI tab says so and offers a link to contact support. Tell us - it is how we decide what to add next.

How long a window stays open

A window opens for three minutes. Every time you use it - a click, a keypress, a drag - it extends by another three minutes, so a window you are working in does not close under you.

There is a limit on the total, and it depends on your plan:

  • Free - one window at a time, up to five minutes
  • Pro, Teacher and Student - five windows at a time, up to fifteen minutes each

That total is shared with debug sessions: a debug session and a GUI window both count towards it.

When the time runs out the window closes and the program ends. Run it again to pick up where you left off.

Using it with the debugger

A GUI window works while you debug. Tick GUI, set your breakpoints and press Debug: your program pauses on the line you chose, and its window is still there in the GUI tab while you step through the code.

Where it is not available

The GUI window is part of the IDE. Embedded JDoodle plugins and the REST API run programs without one, so a program that needs a window should be run here.

If your program says there is no display

An error like no display name and no $DISPLAY environment variable, or HeadlessException, means your program tried to open a window and there was no screen for it. Tick GUI and run it again.

This website uses cookies to ensure you get the best experience on our website.