Skip to main content
IBM HomeProductsConsultingIndustriesNewsAbout IBM
IBM : developerWorks : Java Technology : Education - online courses
J2ME: Step by step
Download tutorial zip fileView letter-sized PDF fileView A4-sized PDF fileE-mail this tutorial to a friend
Main menuSection menuGive feedback on this tutorialPreviousNext
8. Development using KJava GUI components

KJava GUI components page 5 of 6

In addition to the Spotlet class, the KJava API also defines some basic GUI components. Some of the more fundamental GUI components provided by KJava are listed here. Note their similarities with the J2SE AWT components by the same name.

  • Button -- Defines a simple GUI push button. The button can contain either a text label such as "OK" or "Cancel", or a bitmap image.

  • Checkbox -- Defines a GUI checkbox component that either can be checked or unchecked.

  • Dialog -- Defines a pop-up, modal dialog box containing a title, a text string, and a "Dismiss" button.

  • Graphics -- This class is similar to its J2SE cousin, and provides various methods for drawing on a display.

  • RadioButton -- Defines a two-state radio button. Usually used as part of a group of radio buttons, grouped using a RadioGroup object, where only one can be on at a time.

  • RadioGroup -- Represents a group of radio buttons, only one of which can be on, or selected, at a time.

  • ScrollTextBox, SelectScrollTextBox -- Defines a scrolling text box component where the user can enter multiple lines of text. Similar functionality to the J2SE TextArea AWT component.

  • Slider -- Defines a graphical slider, where the user can select a value by sliding a marker along a scale.

  • TextBox -- Defines a basic text box, useful for displaying small amounts of text only. For larger quantities of text, consider using the ScrollTextBox.

  • TextField -- Defines a text box that provides for user input. Similar to the J2SE TextField AWT component.

  • ValueSelector -- A GUI component that accepts an integer value from the user. The user can select "+" to increment the value or "-" to decrement the value.

Main menuSection menuGive feedback on this tutorialPreviousNext