자바 SWT상에서 리스트 항목을 눌렀을때 이벤트를 발생시키고 싶
글쓴이: 다크슈테펜 / 작성시간: 수, 2005/01/19 - 2:40오후
final CTabFolder tabFolder = new CTabFolder(shell, SWT.CLOSE | SWT.BORDER);
tabFolder.setSelectionBackground(new Color[] {Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_BACKGROUND), Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_BACKGROUND_GRADIENT), Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)}, new int[] {50, 100});
tabFolder.setSimple(false);
tabFolder.setTabHeight(-1);
tabFolder.setUnselectedCloseVisible(false);
tabFolder.setBounds(5, 108, 268, 238);
final CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE);
tabItem.setText("기본시스템");
list = new List(tabFolder, SWT.BORDER);
list.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
String string="";
int[] selection=list.getSelectionIndices();
for (int i=0;i<selection.length;i++)
string+=selection[i]+" ";
System.out.println(string);
if (string=="0")
{
final bootconf bootconf_ = new bootconf(shell, SWT.NONE);
bootconf_.setBounds(281, 108, 636, 512);
}
else if (string=="1")
{
final boot bootconf1 = new boot(shell, SWT.NONE);
bootconf1.setBounds(281, 108, 636, 512);
}
}
});
tabItem.setControl(list);
list.add("부트로더");
list.add("로그인화면");
list.add("엑스윈도우");
list.add("사용자및 그룹");
list.add("업데이트체크");
tabFolder.setSelection(tabItem);
자바 SWT상에서 리스트 항목을 눌렀을때 이벤트를 발생시키고 싶습니다.항목을 누르면 그에 맞는 컴포지트로 바꾸고 싶습니다.그런데 이렇게 실행하면 인덱스는 받아옵니다.클릭하면 콘솔창에서 인덱스 번호가 나오는데 바뀌는 이벤트가 발생하지 않습니다.어떻게 해야 하나요..
Forums:


소스를 제대로 보지 않은 제 잘못이군요...[code:1] lis
소스를 제대로 보지 않은 제 잘못이군요...
list.addListener(SWT.Selection,new Listener() { public void handleEvent(Event e) { if(list.getSelectionIndex()==0){ compositedis(); composite1=new bootconf(shell,SWT.NONE); composite1.setBounds(281, 108, 636, 600); }else if (list.getSelectionIndex()==1) { compositedis(); composite2 = new boot(shell, SWT.NONE); composite2.setBounds(281, 108, 636, 600); }else if (list.getSelectionIndex()==2) { compositedis(); composite3 = new xwinconf(shell, SWT.NONE); composite3.setBounds(281, 108, 636, 600); } } });인생이란게 다 그런게 아니겠어요....? 뭘(?)
http://schutepen.egloos.com
댓글 달기