本文整理匯總了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");
}
示例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();
}