在每个上创建一个具有Focusable的GridFieldManager?

时间:2012-01-23 08:51:39

标签: blackberry blackberry-simulator blackberry-eclipse-plugin

我想了解GridFieldManager以及如何了解它。

1 个答案:

答案 0 :(得分:1)

试试这个:

public class GridScreen extends MainScreen
{
GridFieldManager grid;  
public GridScreen() 
{
    setTitle("Grid Screen");
    createGUI();
}
private void createGUI() 
{
    setTitle("GridLayoutDemo");
    GridFieldManager grd=new GridFieldManager(3, 3, 0);
    grd.add(new LabelField("One",Field.FOCUSABLE));
    grd.add(new LabelField("Two"));
    grd.add(new LabelField("Three",Field.FOCUSABLE));
    grd.add(new LabelField("Four",Field.FOCUSABLE));
    grd.add(new LabelField("Five",Field.FOCUSABLE));
    grd.add(new LabelField("Six",Field.FOCUSABLE));
    grd.add(new ButtonField("Seven"));
    grd.add(new ButtonField("Eight"));
    grd.add(new LabelField("Nine"));
  //grd.insert(new LabelField("Insert"), 0, 2);
    grd.delete(1, 1);
 // grd.getBackground();
    add(grd);       
    grd.setColumnPadding(10);
    grd.setRowPadding(10);;
}
}

这只是一个示例GridDemo;据此,你可以做你想做的事; 我只给了一些不是全部的领域;运行时看到这个;