0
배열에서 테이블을 만들 때 첫 번째 열은 배열에있는 값으로 채우고 두 번째 열은 배열 색인 값이있는 ckeckBoxes로 채 웁니다. 내가 선택한 확인란의 이름을 검색해야합니다. 아래 코드는 제발, 아무도 도와 줄 수 있니?gwt 자바에서 확인란의 이름을 얻으십시오
도움 주셔서 감사합니다.
public class AddDoodlePart3 extends Composite {
MainView main = new MainView();
FlexTable table= new FlexTable();
VerticalPanel ab = new VerticalPanel();
HorizontalPanel hor = new HorizontalPanel();
InlineLabel lb = new InlineLabel("tette");
CheckBox ck ;
TextBox orario = new TextBox();
Button btn = new Button("Inserisci");
int culo;
public AddDoodlePart3(String det, ArrayList<String> listDate){
initWidget(this.ab);
this.ab.add(lb);
System.out.println(det+listDate.size());
table.setText(0, 0, " ");
table.setText(0, 1, "Opzione");
table.setText(0, 2, " ");
System.out.println("1");
for(int i=0;i<listDate.size();i++){
System.out.println(i);
this.ck = new CheckBox(""+i);
table.setWidget(i, 0, ck);
table.setText(i, 1, listDate.get(i));
ck.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
boolean checked = ((CheckBox) event.getSource()).getValue();
Window.alert("It is " + (checked ? "" : "not ") + "checked "+ culo);
}
});
}
this.ab.add(table);
this.hor.add(orario);
this.hor.add(btn);
this.ab.add(hor);
btn.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
// System.out.println(culo);
}
});
}
}