Interpreter exit on EOF when interactive

"George Coles" <[email protected]> Wed, 22 Sep 2004 16:31:03 -0400 (EDT)
Newsgroups gmane.comp.java.beanshell.devel
Message-ID <[email protected]>
Hi all,
  I am new to beanshell. I am trying to use it as an interactive command
shell running underanother swing MDI application. I am having some look
and feel problems, because I do not really understand swing.

I have been trying to figure out why the entire app exits suddenly when I
type exit(); in the JConsole window. Interpreter.setExitOnEOF( false )
should keep this from happening in interactive mode. Interactive mode is
the mode I am in when I run the console and type commands into it right?

On line 551 of Interpreter I see something that looks like the issue to me:

if ( interactive && exitOnEOF )
			System.exit(0);

The use of the short-circuit boolean operator would seem to mean that in
interactive mode the Interpreter will close the whole VM when it
encounters an EOF, which overrides the setting of the ExitInEOF property.

I am not a committer, can someone fix this?

Also, how do I keep JConsole from taking up the whole screen when I run it
as a child of another frame? I used the following code to try to run it as
an MDI window:

JInternalFrame intframe = new JInternalFrame("Console",true,true,true,true);
JConsole j = new JConsole();
intframe.setSize(60,25);
intframe.getContentPane().add( j );
Parent.getMainFrame().getContentPane().add( intframe );
intframe.setDefaultCloseOperation( JInternalFrame.DISPOSE_ON_CLOSE );
intframe.pack();
intframe.setVisible( true );
j.setVisible( true );

Interpreter i = new Interpreter( j );
i.setExitOnEOF( false );
i.run();

Thanks,
George



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php