List of utility methods to do Swing FlowLayout
JPanel | addToFlowLayout(JComponent comp, int flowLayoutAlignment) add To Flow Layout JPanel panel = new JPanel(new FlowLayout(flowLayoutAlignment)); panel.add(comp); return panel; |
JPanel | createPanel(LayoutManager layout, Component... components) create Panel JPanel panel = new JPanel(layout); for (Component comp : components) { panel.add(comp); return panel; |
JPanel | flowLayoutPanel(Component... components) flow Layout Panel return newJPanel(new FlowLayout(), components); |
JPanel | getFlowLayoutPanelLeftAligned(String title, Component component) get Flow Layout Panel Left Aligned JPanel jp = new JPanel(); jp.setLayout(new FlowLayout(FlowLayout.LEFT)); if (title != null) { if (component instanceof JPanel) { JPanel p = (JPanel) component; p.setBorder(BorderFactory.createTitledBorder(title)); jp.add(component); return jp; |
JComponent | layoutFlow(JComponent... list) Layout components using a flow layout JPanel p = new JPanel(new FlowLayout()); for (JComponent c : list) p.add(c); return p; |
JPanel | wrapInPanel(final JComponent comp, final LayoutManager lm) Wraps a component in a JPanel with the specified layout manager, and returns it. final JPanel p = new JPanel(lm); p.add(comp); return p; |