public static void setConsoleIO(){
    	if(!(io_handler instanceof Console)){
    		IInputOutput previous = io_handler;
        	// just in case this is invoked by a separate thread..
    		// (all Swing calls must be done from the same thread. invokeLater schedules
    		// this code to be run on that thread as soon as possible)
        	SwingUtilities.invokeLater(new Runnable(){
        		public void run(){
		    		if(gui != null && gui.isDisplayable()){
		    			gui.dispose();
		    			gui = null;
		    		}
		    		io_handler = new Console();
		    		initIO(io_handler);
        		}
        	});
    		// close previous handler
    		if(previous != null) previous.closeStreams();
    	}
    }