java.awt.FlowLayout#setAlignOnBaseline ( )源码实例Demo

下面列出了java.awt.FlowLayout#setAlignOnBaseline ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: netbeans   文件: SummaryCellRenderer.java
public EventRenderer () {
    pathLabel = new JLabel();
    actionLabel = new JLabel();
    actionButton = new LinkButton("..."); //NOI18N
    actionButton.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));

    FlowLayout l = new FlowLayout(FlowLayout.LEFT, 0, 0);
    l.setAlignOnBaseline(true);
    setLayout(l);
    add(actionLabel);
    actionLabel.setBorder(BorderFactory.createEmptyBorder(0, INDENT, 0, 10));
    add(pathLabel);
    add(actionButton);
}
 
源代码2 项目: sldeditor   文件: ToolPanel.java
/**
 * Instantiates a new tool panel.
 *
 * @param parentObj the parent obj
 * @param toolMap the tool map
 */
public ToolPanel(ToolSelectionInterface parentObj, Map<Class<?>, List<ToolInterface>> toolMap) {
    this.toolSelection = parentObj;

    theToolPanel = new JPanel();
    FlowLayout flowLayout = (FlowLayout) theToolPanel.getLayout();
    flowLayout.setAlignOnBaseline(true);
    flowLayout.setVgap(1);
    flowLayout.setHgap(1);

    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    this.add(theToolPanel);

    this.toolMap = toolMap;

    JPanel optionsPanel = new JPanel();
    add(optionsPanel);

    JCheckBox chckbxRecursive =
            new JCheckBox(Localisation.getString(ToolPanel.class, "ToolPanel.recursive"));
    chckbxRecursive.addActionListener(
            new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    toolSelection.setRecursiveFlag(chckbxRecursive.isSelected());
                }
            });
    optionsPanel.add(chckbxRecursive);
    this.setPreferredSize(new Dimension(50, EMPTY_TOOL_PANEL_HEIGHT));
}