第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

對齊按鈕中的 SWT 問題

對齊按鈕中的 SWT 問題

BIG陽 2021-07-11 12:30:30
我編寫了一個小程序,它有 2 個列表視圖和一個用于選擇和取消選擇所選組合的按鈕。問題是我無法將按鈕與列的中心對齊。public static void main(String[] args) {    Display display = new Display();    Shell shell = new Shell(display);    shell.setLayout(new FillLayout());    shell.setLayout(new GridLayout(3, true));    GridData data = new GridData(GridData.FILL_BOTH);    // Creating Label    new Label(shell, SWT.NONE).setText("This is a plain Text");    new Label(shell, SWT.NONE).setText("");    new Label(shell, SWT.NONE).setText("This is a plain Text");    // Create a single-selection list    List single = new List(shell, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL);    single.setLayoutData(data);    // Add the items, one by one    for (int i = 0, n = ITEMS.length; i < n; i++) {        single.add(ITEMS[i]);    }    single.setSelection(0);    //////////////////////////////////////////////////////    // Button button1=new Button(shell, SWT.ARROW | SWT.RIGHT);    Group first = new Group(shell, SWT.CENTER);    first.setLayout(new RowLayout(SWT.VERTICAL));    Button button1 = new Button(first, SWT.NONE);    // GridData bdata = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);    Button button3 = new Button(first, SWT.PUSH);    // button3.setLayoutData(bdata);    button1.setText("Select    ");    button3.setText("UnSelect");    //////////////////////////////////////////////    // Create a single-selection list    List single2 = new List(shell, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL);    single2.setLayoutData(data);    single2.add("");    single2.setSelection(0);    shell.open();    System.out.println(single.getItem(single.getSelectionIndex()));    while (!shell.isDisposed()) {        if (!display.readAndDispatch()) {            display.sleep();        }    }    display.dispose();}實(shí)際輸出:預(yù)期輸出:
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 183 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號