//建立左边标题部分
Panel leftPanel=new Panel();
Label bmLabel=new Label( "部门: ");
Label xmLabel=new Label( "姓名: ");
Label csLabel=new Label( "出生: ");
Label gzLabel=new Label( "工资: ");
setLayout(new GridLayout(4,0));
leftPanel.add(bmLabel);
leftPanel.add(xmLabel);
leftPanel.add(csLabel);
leftPanel.add(gzLabel);
add(leftPanel, "West ");
//建立右边的填入框
Panel rightPanel=new Panel();
Choice bmChoice=new Choice();
bmChoice.add( "部门1 ");
bmChoice.add( "部门2 ");
bmChoice.add( "部门2 ");
TextField xmText=new TextField(10);
TextField csText=new TextField(10);
TextField gzText=new TextField(10);
setLayout(new GridLayout(4,0));
rightPanel.add(bmChoice);
rightPanel.add(xmText);
rightPanel.add(csText);
rightPanel.add(gzText);
add(rightPanel, "East ");
如我的代码,我想把文字放左边,控件放右边,可是这样不行,我是新手,请各位帮帮忙啊
------解决方案--------------------
Panel leftPanel=new Panel();
Label bmLabel=new Label( "部门: ");
Choice bmChoice=new Choice();
bmChoice.add( "部门1 ");
bmChoice.add( "部门2 ");
bmChoice.add( "部门2 ");
setLayout(new GridLayout(4,0));
leftPanel.add(bmLabel);
leftPanel.add(bmChoice);
add(leftPanel, "West ");