Java Code Examples for java.awt.FlowLayout#setAlignOnBaseline()

The following examples show how to use java.awt.FlowLayout#setAlignOnBaseline() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SummaryCellRenderer.java    From netbeans with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example 2
Source File: ToolPanel.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
/**
 * 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));
}