A Environment object is a substitute for the usual environment
as defined in the
java.lang.System class, most important the
stdin and stdout channels
java.lang.System.in
and
java.lang.System.out .
Environments are especially useful in classes that can be used both standalone
(having a main method) or in an application where the class is
only one of many. Another scenario would be a simple class designed for use
from the command line that should suddenly be invoked in GUI framework without
redirecting the default channels
java.lang.System.in and
java.lang.System.out .
To obtain an Environment instance or to store such instances
use the class
EnvironmentProvider :
Environment env = EnvironmentProvider.getEnvironment(this);
author: Heiko Blau |