當前位置: 首頁>>代碼示例>>Java>>正文


Java Spinner.addKeyListener方法代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.Spinner.addKeyListener方法的典型用法代碼示例。如果您正苦於以下問題:Java Spinner.addKeyListener方法的具體用法?Java Spinner.addKeyListener怎麽用?Java Spinner.addKeyListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.widgets.Spinner的用法示例。


在下文中一共展示了Spinner.addKeyListener方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: LinesPerPageDialog

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private LinesPerPageDialog(Shell parentShell)
{
	shell = new Shell(parentShell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
	shell.setText("Lines per Page");
	shell.setLayout(new GridLayout(3, true));

	spinner = new Spinner(shell, 0);
	spinner.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
	spinner.setValues(bzStyledText.getLinesPerPage(), 0, 225, 0, 1, 10);
	spinner.addKeyListener(this);

	okButton = new Button(shell, SWT.PUSH);
	okButton.setText("OK");
	okButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
	okButton.addSelectionListener(this);

	cancelButton = new Button(shell, SWT.PUSH);
	cancelButton.setText("Cancel");
	cancelButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
	cancelButton.addSelectionListener(this);

	shell.pack();
	shell.open();
}
 
開發者ID:MikeGray-APH,項目名稱:BrailleZephyr,代碼行數:25,代碼來源:BZMenu.java

示例2: CharsPerLineDialog

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private CharsPerLineDialog(Shell parentShell)
{
	shell = new Shell(parentShell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
	shell.setText("Characters Per Line");
	shell.setLayout(new GridLayout(3, true));

	spinner = new Spinner(shell, 0);
	spinner.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
	spinner.setValues(bzStyledText.getCharsPerLine(), 0, 27720, 0, 1, 10);
	spinner.addKeyListener(this);

	okButton = new Button(shell, SWT.PUSH);
	okButton.setText("OK");
	okButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
	okButton.addSelectionListener(this);

	cancelButton = new Button(shell, SWT.PUSH);
	cancelButton.setText("Cancel");
	cancelButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
	cancelButton.addSelectionListener(this);

	shell.pack();
	shell.open();
}
 
開發者ID:MikeGray-APH,項目名稱:BrailleZephyr,代碼行數:25,代碼來源:BZMenu.java

示例3: LineMarginBellDialog

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private LineMarginBellDialog(Shell parentShell)
{
	shell = new Shell(parentShell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
	shell.setText("Bell Margin");
	shell.setLayout(new GridLayout(3, true));

	spinner = new Spinner(shell, 0);
	spinner.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
	spinner.setValues(bzStyledText.getLineMarginBell(), 0, 27720, 0, 1, 10);
	spinner.addKeyListener(this);

	okButton = new Button(shell, SWT.PUSH);
	okButton.setText("OK");
	okButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
	okButton.addSelectionListener(this);

	cancelButton = new Button(shell, SWT.PUSH);
	cancelButton.setText("Cancel");
	cancelButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
	cancelButton.addSelectionListener(this);

	shell.pack();
	shell.open();
}
 
開發者ID:MikeGray-APH,項目名稱:BrailleZephyr,代碼行數:25,代碼來源:BZMenu.java

示例4: PageMarginBellDialog

import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private PageMarginBellDialog(Shell parentShell)
{
	shell = new Shell(parentShell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
	shell.setText("Bell Page");
	shell.setLayout(new GridLayout(3, true));

	spinner = new Spinner(shell, 0);
	spinner.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
	spinner.setValues(bzStyledText.getPageMarginBell(), 0, 27720, 0, 1, 10);
	spinner.addKeyListener(this);

	okButton = new Button(shell, SWT.PUSH);
	okButton.setText("OK");
	okButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
	okButton.addSelectionListener(this);

	cancelButton = new Button(shell, SWT.PUSH);
	cancelButton.setText("Cancel");
	cancelButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
	cancelButton.addSelectionListener(this);

	shell.pack();
	shell.open();
}
 
開發者ID:MikeGray-APH,項目名稱:BrailleZephyr,代碼行數:25,代碼來源:BZMenu.java


注:本文中的org.eclipse.swt.widgets.Spinner.addKeyListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。