All of the examples in this section will only run properly in wish.
Because you need an event loop to allow the GUI to respond to input from graphical widgets. You can make an event loop in tclsh b executing this code after creating all the Java widgets:set hangHere 0 vwait hangHereThe only problem with this is that the interactive console will no longer respond! So this is not so useful for exploration and debugging. Once you have a Java GUI working in wish, though, you can add this code to the bottom of your script and run it in tclsh.