基于Eclipse 3.0的SWT编程 - 编程入门网
作者 佚名技术
来源 NET编程
浏览
发布时间 2012-06-17
nal Display display = new Display(); shell = new Shell(); shell.setSize(610, 477); shell.setText("Address Book"); { newButton = new Button(shell, SWT.NONE); newButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { clearText(); setTextEditable(true); enableEditButtons(false); enableSaveButtons(true); System.out.println("New button selected."); } }); newButton.setBounds(10, 380, 75, 35); newButton.setText("New"); } { deleteButton = new Button(shell, SWT.NONE); deleteButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { clearText(); System.out.println("Delete button selected."); } }); deleteButton.setBounds(85, 380, 75, 35); deleteButton.setText("Delete"); } { editButton = new Button(shell, SWT.NONE); editButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { setTextEditable(true); enableEditButtons(false); enableSaveButtons(true); System.out.println("Edit button selected."); } }); editButton.setBounds(160, 380, 75, 35); editButton.setText("Edit"); } { prevButton = new Button(shell, SWT.NONE); prevButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { System.out.println("Previous button selected."); } }); prevButton.setBounds(265, 380, 75, 35); prevButton.setText("Previous"); } { nextButton = new Button(shell, SWT.NONE); nextButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { System.out.println("Next button selected."); } }); nextButton.setBounds(340, 380, 75, 35); nextButton.setText("Next"); } { saveButton = new Button(shell, SWT.NONE); saveButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { setTextEditable(false); enableEditButtons(true); enableSaveButtons(false); System.out.println("Save button selected."); } }); saveButton.setBounds(445, 380, 75, 35); saveButton.setText("Save"); saveButton.setEnabled(false); } { cancelButton = new Button(shell, SWT.NONE); cancelButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { setTextEditable(false); enableEditButtons(true); enableSaveButtons(false); System.out.println("Cancel button selected."); } }); cancelButton.setBounds(520, 380, 75, 35); cancelButton.setText("Cancel"); cancelButton.setEnabled(false); } { final Group group = new Group(shell, SWT.NONE); group.setText("Detai |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
关于基于Eclipse 3.0的SWT编程 - 编程入门网的所有评论