Method Summary |
void |
actionPerformed(ActionEvent e)
Called when a component (typically a button) is activated. |
void |
addActionListeners()
Adds the program as an ActionListener to every button in
the structure that does not have a listener already. |
void |
addActionListeners(ActionListener listener)
Adds the specified listener to every button in
the structure that does not have a listener already. |
void |
addExitHook(Object obj)
Requests that the program call the exit method in the
specified object before exiting. |
void |
exit()
Exits from the program. |
IOConsole |
getConsole()
Returns the console associated with this program. |
IODialog |
getDialog()
Returns the dialog used for user interaction. |
IOModel |
getInputModel()
Returns the IOModel used for program input, which will
typically be either the default IOConsole or IODialog object. |
ProgramMenuBar |
getMenuBar()
Returns the menu bar associated with this program. |
IOModel |
getOutputModel()
Returns the IOModel used for program output, which will
typically be either the default IOConsole or IODialog object. |
BufferedReader |
getReader()
Returns a BufferedReader whose input comes from the console. |
String |
getTitle()
Gets the title of this program. |
PrintWriter |
getWriter()
Returns a PrintWriter whose output is directed to the console. |
void |
init()
The init method is called at startup time before the run method is
called. |
void |
main(String[] args)
Every application must either contain a "Main-Class" entry in its
manifest file or include a main method that looks like this, where
MyClass is the name of the program class:
|
void |
menuAction(String cmd)
Called whenever an action event is detected in the menu bar. |
void |
mouseClicked(MouseEvent e)
Called when the mouse is clicked. |
void |
mouseDragged(MouseEvent e)
Called when the mouse is dragged with the button down. |
void |
mouseEntered(MouseEvent e)
Called when the mouse enters the source (which may be
either a component or a GObject). |
void |
mouseExited(MouseEvent e)
Called when the mouse exits the source (which may be
either a component or a GObject). |
void |
mouseMoved(MouseEvent e)
Called when the mouse is moved. |
void |
mousePressed(MouseEvent e)
Called when the mouse button is pressed. |
void |
mouseReleased(MouseEvent e)
Called when the mouse button is released. |
void |
pause(double milliseconds)
Delays the calling thread for the specified time, which is expressed in
milliseconds. |
void |
print(String value)
Displays the argument value on the console, leaving the cursor at the end of
the output. |
void |
println()
Advances the console cursor to the beginning of the next line. |
void |
println(String value)
Displays the argument value on the console and then advances the cursor
to the beginning of the next line. |
boolean |
readBoolean()
Reads and returns a boolean value (true or false). |
boolean |
readBoolean(String prompt)
Prompts the user to enter a boolean value, which is returned as
the value of this method. |
boolean |
readBoolean(String prompt,
String trueLabel,
String falseLabel)
Prompts the user to enter a boolean value, which is matched against the
labels provided. |
double |
readDouble()
Reads and returns a double-precision value from the user. |
double |
readDouble(double low,
double high)
Reads and returns a double-precision value from the user, which is
constrained to be within the specified inclusive range. |
double |
readDouble(String prompt)
Prompts the user to enter an double-precision number, which is then
returned as the value of this method. |
double |
readDouble(String prompt,
double low,
double high)
Prompts the user to enter an double-precision number, which is then returned
as the value of this method. |
int |
readInt()
Reads and returns an integer value from the user. |
int |
readInt(int low,
int high)
Reads and returns an integer value from the user, which is constrained to
be within the specified inclusive range. |
int |
readInt(String prompt)
Prompts the user to enter an integer, which is then returned as the value
of this method. |
int |
readInt(String prompt,
int low,
int high)
Prompts the user to enter an integer, which is then returned as the value
of this method. |
String |
readLine()
Reads and returns a line of input from the console. |
String |
readLine(String prompt)
Prompts the user for a line of input. |
void |
run()
Contains the code to be executed for each specific program subclass. |
void |
setConsole(IOConsole console)
Sets the console associated with this program. |
void |
setTitle(String title)
Sets the title of this program. |
void |
showErrorMessage(String msg)
Displays the error message in the standard output model. |
void |
start(String[] args)
Starts the program using the specified argument list. |