BlueJ logo

BlueJ – Resources

Search:
Home
What is BlueJ?
Why BlueJ?
Download
Documentation
Extensions
Help & Info
Resources
Users
User comments
Contributors

Mailing Lists

Read or subscribe to:

BlueJ-announce
announcements of new releases
BlueJ-discuss
BlueJ related discussion

Bug Parade

View or submit bugs


 

Java Classes

Simple Input

A Java class for getting input into a program in a simple manner. The class has methods such as getInt(prompt) or getString(prompt), which pop up an input window and return the result.

Author(s): Bruce Quig (bruce.quig@infotech.monash.edu.au) , Michael Kölling (mik@mip.sdu.dk).

Submitted by: Michael Kölling

Known uses: I have used this class very successfully in a first assignment in first semester (before other forms of input were introduced). Once students understand method calls, it is very straight forward to use.

Hints for use: Save the source file, then use the "Import Class" function in BlueJ to import this class into your project. Then it can be used like any other class.

See also: -

Link(s): SimpleInput.java (right-click or shift-click to save)

User comments:

No comments submitted.
Add your own comment.


Canvas

A Java class for drawing into a window. This class provides output only (no events). It can be used to produce drawings and animations. Very simple to use.

Author(s): Bruce Quig (bruce.quig@infotech.monash.edu.au), Michael Kölling (mik@mip.sdu.dk).

Submitted by: Michael Kölling

Known uses: I have used this class for a second semester assignment. Students implemented simulations (such as a lift simulation) and used this class to produce animated output.

Hints for use: Save the source file, then use the "Import Class" function in BlueJ to import this class into your project. Then it can be used like any other class.

See also: The Bouncing Ball example in the Demonstrations section demonstrates the use of this class.

Link(s): Canvas.java (right-click or shift-click to save)

User comments:

No comments submitted.
Add your own comment.


stdio

stdio defines static methods for using typed input from the console window. This class includes two methods for getting a line of input, two methods for handling (i.e. parsing) typed-in numbers, and a simple rounding method so that System.out.println won't print "0.33333333333333333" when you want to see "0.33".

Author(s): Michael Trigoboff (michael.trigoboff@pcc.edu)

Submitted by: Michael Trigoboff

Known uses: I have used this class successfully as a way to let my students produce command-line applications that they can run in a MS-DOS command line window. This lets them get started without first having to climb the learning curve for Java GUI programming (AWT and Swing).

Hints for use: Put stdio.java and stdio.class into your project folder and then use stdio in your project as you would use any other class.

See also: -

Link(s):

stdio.java (the source file, right-click or shift-click to save)
stdio.class (the compiled class file)
stdio.html (javadoc format documentation for stdio)
StdioTest.java (a small example program for using stdio)

stdio.jar (all of the above together in a single jar file)

User comments:

No comments submitted.
Add your own comment.


GWindow

An implementation of a GUI window (JFrame) to test AWT/Swing components and graphics primitives. From the documentation: "This window will work properly if opened from within a JAR file that is executed from the DOS command line because it provides a method that allows a thread to wait until the window is closed."

Author(s): Michael Trigoboff (michael.trigoboff@pcc.edu)

Submitted by: Michael Trigoboff

Known uses: I have used GWindow successfully as a way to let my students run and test code that uses Java graphics primitives. It is also a way to test AWT and Swing user interfaces without incurring the debugging limitations caused by using an applet.

Hints for use: See GWindowDemo for an example of how to use GWindow.

See also: -

Link(s):

gwindow.jar (the jar file contains the GWindow class, the demo class and documentation)

User comments:

No comments submitted.
Add your own comment.


AppletWindow

AppletWindow is a window framework that lets you run applets in a normal JFrame. This allows you to use the BlueJ debugger on your applet.

Author(s): Michael Trigoboff (michael.trigoboff@pcc.edu)

Submitted by: Michael Trigoboff

Known uses: Run an applet in a JFrame-based window.

Hints for use: The .jar file includes a simple demo class and a simple applet.

See also: -

Link(s):

appletwn.jar (includes a simple demo class and a simple applet)

User comments:

No comments submitted.
Add your own comment.

 

 

maintained by Michael Kölling.