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


Java Combo.pack方法代碼示例

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


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

示例1: init

import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
void init() {
//		this.setLayout(new GridLayout(2, false));
		this.setLayout(new FillLayout());
		
		day = new Combo(this, SWT.READ_ONLY);
		for (int i=1; i<=31; ++i)
			day.add(""+i);
		day.select(0);
		day.pack();
//		day.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
		
		month = new Combo(this, SWT.READ_ONLY);
		for (int i=1; i<=12; ++i)
			month.add(""+i);
		month.select(0);
		month.pack();
//		month.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
		
		year = new StyledText(this, SWT.SINGLE | SWT.CENTER | SWT.LEFT | SWT.BORDER);
		year.setText("2000");
//		year.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
		
		this.pack();
		
		addListener();
	}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:27,代碼來源:SCSimpleDateTimeWidget.java

示例2: createScheduleTimeSection

import org.eclipse.swt.widgets.Combo; //導入方法依賴的package包/類
private Composite createScheduleTimeSection(final Composite parent) {
    final Composite timeSection = new Composite(parent, SWT.NONE);
    SWTUtil.gridLayout(timeSection, 2);

    final TimeZone tz = TimeZone.getDefault();
    final Locale locale = Locale.getDefault();
    final Calendar now = new GregorianCalendar(tz, locale);

    scheduleTimeCombo = new Combo(timeSection, SWT.READ_ONLY);
    // List the day in 30 minute internals.
    final Calendar time = Calendar.getInstance();
    CalendarUtils.removeTime(time);
    secondsAfterMidnight = new int[48];
    for (int i = 0; i < 48; i++) {
        scheduleTimeCombo.add(TIME_FORMAT.format(time.getTime()));
        secondsAfterMidnight[i] = CalendarUtils.getSecondsSinceMidnight(time);
        time.add(Calendar.MINUTE, 30);
    }
    // Select a default time (3am) using the same algorithm as
    // Microsoft's client
    setScheduleTimeAsSecondsAfterMidnight(10800);

    scheduleTimeCombo.pack();

    SWTUtil.createLabel(timeSection, tz.getDisplayName(tz.inDaylightTime(now.getTime()), TimeZone.LONG));

    return timeSection;
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:29,代碼來源:TriggerTabPage.java


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