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


Java FlowLayout.setHgap方法代碼示例

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


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

示例1: StatusLineComponent

import java.awt.FlowLayout; //導入方法依賴的package包/類
public StatusLineComponent() {
        handleComponentMap = new HashMap<InternalHandle, ListComponent>();
        FlowLayout flay = new FlowLayout();
        flay.setVgap(1);
        flay.setHgap(5);
        setLayout(flay);
        mouseListener = new MListener();
        addMouseListener(mouseListener);
        hideListener = new HideAWTListener();
        
        createLabel();
        createBar();
        // tricks to figure out correct height.
        bar.setStringPainted(true);
        bar.setString("@@@"); // NOI18N
        label.setText("@@@"); // NOI18N
        preferredHeight = Math.max(label.getPreferredSize().height, bar.getPreferredSize().height) + 3;
        setOpaque(false);
        discardLabel();
        discardBar();
        
        pane = new PopupPane();
        pane.getActionMap().put("HidePopup", new AbstractAction() {
            public @Override void actionPerformed(ActionEvent actionEvent) {
//                System.out.println("escape pressed - hiding");
                hidePopup();
            }
        });
        pane.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "HidePopup");
        pane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "HidePopup");
        
        
    }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:34,代碼來源:StatusLineComponent.java

示例2: JChoice

import java.awt.FlowLayout; //導入方法依賴的package包/類
/**
 * Creates a FastChoice with the given data model.
 */
public JChoice(ComboBoxModel<E> model) {
  layout = new FlowLayout();
  layout.setHgap(0);
  layout.setVgap(0);
  layout.setAlignment(FlowLayout.LEFT);
  setLayout(layout);
  this.model = model;
  //by default nothing is selected
  setSelectedItem(null);
  initLocalData();
  buildGui();
}
 
開發者ID:GateNLP,項目名稱:gate-core,代碼行數:16,代碼來源:JChoice.java


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