Open Source & Free  



This is the second is a series of blog posts hightlighting some of the components available in the CodeRAD cn1lib. The first post (or series of posts) introduced the RAD Chatroom component, a rich 2nd order UI component that encapsulates the user interface for a fully functional chat room.

A second-order UI component is a complex UI component, usually composed of multiple basic components, which is designed for a specific type of application. Some examples of second-order UI components are login forms, contacts lists, chat room components, news lists, etc..

In this post I share a much simpler, first-order component: The HelpButton. The HelpButton is just a button that displays a “Help” or “Error” icon. When the user clicks on this button, it pops up with some “help” text.

Usage Example

The following is the snippet that was used to generate the above screen capture:

Form hi = new Form("Hi World", BoxLayout.y());
HelpButton btn = new HelpButton("This is some help text to give you some hints");
hi.add(FlowLayout.encloseIn(new Label("Hi World"), btn));;

There really isn’t much to this component, but it is a handy addition to the toolbox nonetheless.

To use the HelpButton component you’ll need to add the CodeRAD cn1lib to your project, which is available in through Codename One preferences. For instructions on adding cn1libs to your projects, see this tutorial.

For more information about CodeRAD, check out its github repo.

Leave a Reply