UI Components for Java ME


The true power of Java ME Low Level UI API

Grid

Grid is one of the best components in this project. It is a kind of component that Java ME could not have left to provide to the developers. It is a single line text per item list. However, their items support columns. For each columns you can specify the name, width, type and alignment (i.e. LEFT, CENTER and RIGHT). As other features, we can list.

Features

  • Support N columns
  • Column sorting according to the item's value type
  • Editable cells
  • Horizontal and Vertical scroll bar
  • Customizable column color

Main Methods

  • public void append(Object values, Image img)
  • public void addColumn(String name, int width, int align, int type)
  • public void setCellAsEditable(int item, int column, boolean enabled)
  • public void sort(int column)

Code Snippet

Grid g = new Grid("Phone Book");
g.addColumn("Name", 50, UIUtil.ALIGN_LEFT, Grid.STRING);
g.addColumn("Mobile", 50, UIUtil.ALIGN_CENTER, Grid.STRING);
g.append(new Object[] {"Adams", "+1-202-203-8765"}, null);
g.append(new Object[] {"Michael", "+1-402-802-1832"}, null);

Screenshots