本文整理汇总了Java中java.awt.FlowLayout.setVgap方法的典型用法代码示例。如果您正苦于以下问题:Java FlowLayout.setVgap方法的具体用法?Java FlowLayout.setVgap怎么用?Java FlowLayout.setVgap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.FlowLayout
的用法示例。
在下文中一共展示了FlowLayout.setVgap方法的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();
}