This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

edparrish presents ...


GUI World

This project emulates the Java GUI components for Buttons, Labels and
TextFields. The component system includes:
- ActionListener style callback support for Buttons and TextFields
- a focus subsystem (important for components with text input)
- ability to change the look by setting sizes, colors and borders

Move your mouse over the buttons and notice the rollover effect. Also,
try selecting text in the text boxes with your mouse. You can change the
highlighted text by typing the new characters.

To use the components, copy the GUIComponent superclass into your project along with any components you want to use.

You can change the look of any component by changing sizes, fonts, foreground and background colors and borders. The GUIWorld class has many examples of how to use various features of the components.

This GUI collection grew out of my need for text components for my Greenfoot Jeopardy game (see

Download the scenario and see the README.TXT file (Scenario Information) for design notes.

13789 views / 1628 in the last 7 days

18 votes | 0 in the last 7 days

Tags: mouse demo with-source reusable gui cabrillo

This scenario is a member of: Reusable actors & support classes

open in greenfoot

There is no HTML 5 translation of this scenario available.
View legacy version (requires Java plugin)

This scenarios uses Java features that are not available for use after conversion to HTML 5. Please try the legacy version, which requires the Java plugin to be installed.

A new version of this scenario was uploaded on Tue Aug 16 00:59:37 UTC 2011 Fixed a minor documentation issue in TextField.


Can you publish the source code ? I wanna take some buttons like described in here ! MrIncredible
A new version of this scenario was uploaded on Tue Aug 16 16:47:59 UTC 2011 Added souce code since I mistakenly forgot to check the box.


Hi MrIncredible, I added the source code. I mistakenly forgot to check the Publish source code checkbox when I published. Thanks for pointing this out to me. Regards, ed parrish
I like. But there is significant input delay for the text box to a point where fast typing will cause characters to be skipped.
I like. But there is significant input delay for the text box to a point where fast typing will cause characters to be skipped.


limefortheworld, just increasing the speed of the scenario should help with that (use the speed slider).


Hi limefortheworld, Thanks for the feedback. I see the effect if I like roll the "asd" keys as fast as I can, though I have not noticed it in normal typing. You must be a fast typist! Since the component runs inside of Greenfoot, it depends on Greenfoot to handle keyboard input and buffering. I think the only thing to do for now is to increase the scenario speed as davmac suggested.
Yeah, I think this is a Greenfoot limitation caused by Greenfoot's design. I'd think it's going to be difficult to circumvent that, seeing as I tried max speed on an i5 and it still yield that error. I am not that fast of a typer, so I just wanted you to notice that. Cheers to you. :)


Hi limefortheworld, Thanks again for the feedback. I think I was pushing the envelope with the TextField. :) Regards, Ed Parrish

See all comments

Want to leave a comment? You must first log in.

Who likes this?

dangjavageek nachocab 8bitcarrotjuice Upupzealot ShoutToUs Gevater_Tod4711 Game/maniac SPower yunan.helmy limefortheworld MrIncredible kiarocks Herman mik samueldora Builderboy2005 GershiBelshi mjrb4