FlowLayout
Code IndexAdd Codota to your IDE (free)

Best code snippets using java.awt.FlowLayout(Showing top 20 results out of 1,971)

Refine search

  • Container
  • JFrame
  • JPanel
  • Window
  • JButton
  • JLabel
  • Common ways to obtain FlowLayout
private void myMethod () {
FlowLayout f =
  • new FlowLayout()
  • new FlowLayout(int3, int1, int2)
  • Smart code suggestions by Codota
}
origin: log4j/log4j

public LogFactor5LoadingDialog(JFrame jframe, String message) {
 super(jframe, "LogFactor5", false);
 JPanel bottom = new JPanel();
 bottom.setLayout(new FlowLayout());
 JPanel main = new JPanel();
 main.setLayout(new GridBagLayout());
 wrapStringOnPanel(message, main);
 getContentPane().add(main, BorderLayout.CENTER);
 getContentPane().add(bottom, BorderLayout.SOUTH);
 show();
}
//--------------------------------------------------------------------------
origin: log4j/log4j

protected JPanel createStatusArea() {
 JPanel statusArea = new JPanel();
 JLabel status =
   new JLabel("No log records to display.");
 _statusLabel = status;
 status.setHorizontalAlignment(JLabel.LEFT);
 statusArea.setBorder(BorderFactory.createEtchedBorder());
 statusArea.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
 statusArea.add(status);
 return (statusArea);
}
origin: zxing/zxing

private GUIRunner() {
 imageLabel = new JLabel();
 textArea = new JTextArea();
 textArea.setEditable(false);
 textArea.setMaximumSize(new Dimension(400, 200));
 Container panel = new JPanel();
 panel.setLayout(new FlowLayout());
 panel.add(imageLabel);
 panel.add(textArea);
 setTitle("ZXing");
 setSize(400, 400);
 setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
 setContentPane(panel);
 setLocationRelativeTo(null);
}
origin: stackoverflow.com

 private void makeGUI()
{
  final JFrame f = new JFrame();
  f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  f.getContentPane().setLayout(new FlowLayout());

  // include: "class AnswerWorker" code here.
  // include: "JButton" b code here.

  f.getContentPane().add(b);
  f.getContentPane().add(new JButton("Nothing"));
  f.pack();
  f.setVisible(true);
}
origin: log4j/log4j

public LogFactor5ErrorDialog(JFrame jframe, String message) {
 super(jframe, "Error", true);
 JButton ok = new JButton("Ok");
 ok.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent e) {
   hide();
  }
 });
 JPanel bottom = new JPanel();
 bottom.setLayout(new FlowLayout());
 bottom.add(ok);
 JPanel main = new JPanel();
 main.setLayout(new GridBagLayout());
 wrapStringOnPanel(message, main);
 getContentPane().add(main, BorderLayout.CENTER);
 getContentPane().add(bottom, BorderLayout.SOUTH);
 show();
}
//--------------------------------------------------------------------------
origin: log4j/log4j

public CategoryNodeRenderer() {
 _panel.setBackground(UIManager.getColor("Tree.textBackground"));
 if (_sat == null) {
  // Load the satellite image.
  String resource =
    "/org/apache/log4j/lf5/viewer/images/channelexplorer_satellite.gif";
  URL satURL = getClass().getResource(resource);
  _sat = new ImageIcon(satURL);
 }
 setOpaque(false);
 _checkBox.setOpaque(false);
 _panel.setOpaque(false);
 // The flowlayout set to LEFT is very important so that the editor
 // doesn't jump around.
 _panel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
 _panel.add(_checkBox);
 _panel.add(this);
 setOpenIcon(_sat);
 setClosedIcon(_sat);
 setLeafIcon(_sat);
}
origin: log4j/log4j

super(jframe, title, true);
JPanel bottom = new JPanel();
bottom.setLayout(new FlowLayout());
JPanel main = new JPanel();
main.setLayout(new FlowLayout());
main.add(new JLabel(label));
_textField = new JTextField(size);
main.add(_textField);
JButton ok = new JButton("Ok");
ok.addActionListener(new ActionListener() {
 public void actionPerformed(ActionEvent e) {
  hide();
JButton cancel = new JButton("Cancel");
cancel.addActionListener(new ActionListener() {
 public void actionPerformed(ActionEvent e) {
bottom.add(ok);
bottom.add(cancel);
getContentPane().add(main, BorderLayout.CENTER);
getContentPane().add(bottom, BorderLayout.SOUTH);
pack();
centerWindow(this);
origin: Konloch/bytecode-viewer

this.fcn = fcn;
getContentPane().setLayout(new BorderLayout());
getContentPane().add(tabs, BorderLayout.CENTER);
buttonPanel = new JPanel(new FlowLayout());
refreshClass = new JButton("Refresh");
refreshClass.addActionListener(this);
buttonPanel.add(refreshClass);
buttonPanel.setVisible(false);
getContentPane().add(buttonPanel, BorderLayout.SOUTH);
origin: libgdx/libgdx

@Override
public void run () {
  JPanel panel = new JPanel(new FlowLayout());
  JPanel textPanel = new JPanel() {
    public boolean isOptimizedDrawingEnabled () {
      return false;
  };
  textPanel.setLayout(new OverlayLayout(textPanel));
  panel.add(textPanel);
  textPanel.add(textField);
  final JLabel placeholderLabel = new JLabel(hint);
  placeholderLabel.setForeground(Color.GRAY);
  placeholderLabel.setAlignmentX(0.0f);
  textPanel.add(placeholderLabel, 0);
origin: stanfordnlp/CoreNLP

JPanel buttonPanel = new JPanel();
buttonPanel.setBackground(Color.WHITE);
buttonPanel.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
FlowLayout fl = new FlowLayout();
fl.setAlignment(FlowLayout.RIGHT);
buttonPanel.setLayout(fl);
tagButton.setText("Tag sentence!");
tagButton.setBackground(Color.WHITE);
buttonPanel.add(tagButton);
tagButton.addActionListener(e -> performTagAction(e));
origin: stackoverflow.com

final JFrame frame = new JFrame("Nested Layout Example");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JPanel gui = new JPanel(new BorderLayout(5,5));
gui.setBorder( new TitledBorder("BorderLayout(5,5)") );
JPanel plafComponents = new JPanel(
  new FlowLayout(FlowLayout.RIGHT, 3,3));
plafComponents.setBorder(
  new TitledBorder("FlowLayout(FlowLayout.RIGHT, 3,3)") );
plafComponents.add(plafChooser);
plafComponents.add(pack);
gui.add(plafComponents, BorderLayout.NORTH);
  new TitledBorder("GridLayout(0,2,3,3)") );
JButton addNew = new JButton("Add Another Label");
    labels.add( new JLabel("Label " + ++labelCount) );
frame.setContentPane(gui);
frame.pack();
origin: Konloch/bytecode-viewer

public TabbedPane(String name, final JTabbedPane pane) {
  super(new FlowLayout(FlowLayout.LEFT, 0, 0));
  label.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
  button.setComponentPopupMenu(pop_up);
  button.addMouseListener(new MouseListener() {
      @Override
      public void mouseClicked(MouseEvent e) {
origin: stackoverflow.com

JFrame frame = new JFrame("Layout Example");
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
borderPanel.setBackground(Color.WHITE);
for (int i = 0; i < 5; i++) {
  buttons[i] = new JButton(borderConstraints[i]);
  borderPanel.add(buttons[i], borderConstraints[i]);
contentPane.add(borderPanel);
flowPanel = new JPanel(new FlowLayout(
      FlowLayout.CENTER, hGap, vGap));
flowPanel.setBorder(
flowPanel.setBackground(Color.WHITE);
for (int i = 5; i < 8; i++) {
  buttons[i] = new JButton(Integer.toString(i));
  flowPanel.add(buttons[i]);
gridPanel.setBackground(Color.WHITE);
for (int i = 8; i < 12; i++) {
  buttons[i] = new JButton(Integer.toString(i));
JPanel panel = new JPanel(new FlowLayout(
      FlowLayout.CENTER, hGap, vGap));
panel.setOpaque(true);
origin: libgdx/libgdx

  JPanel fontPanel = new JPanel();
    fontPanel.add(new JLabel("Size:"), new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.EAST,
      GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0));
      GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0));
      bitmapPanel.add(new JLabel("Gamma:"), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST,
        GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0));
    browseButton = new JButton("...");
    browseButton.setMargin(new Insets(0, 0, 0, 0));
    fontPanel.add(new JLabel("Rendering:"), new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST,
      GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0));
    sampleNeheButton = new JButton();
getContentPane().add(rightSidePanel, new GridBagConstraints(1, 0, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER,
  GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    FlowLayout advancePanelLayout = new FlowLayout();
origin: chewiebug/GCViewer

protected void initComponents() {
  Panel buttonPanel = new Panel();
  buttonPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
  JButton okButton = new JButton(LocalisationHelper.getString("button_ok"));
  okButton.setActionCommand(ACTION_OK);
  okButton.addActionListener(this);
  buttonPanel.add(okButton);
  
  getContentPane().add("South", buttonPanel);
}

origin: stackoverflow.com

 JFrame frame = new JFrame();
frame.getContentPane().setLayout(new FlowLayout());
frame.getContentPane().add(new JLabel(new ImageIcon(img)));
frame.getContentPane().add(new JLabel(new ImageIcon(img2)));
frame.getContentPane().add(new JLabel(new ImageIcon(img3)));
frame.pack();
frame.setVisible(true);
//frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // if you want the X button to close the app
origin: stackoverflow.com

 import java.awt.*;
import javax.swing.*;

 public class DemoJTextFieldWithLimit extends JApplet{
  JTextField textfield1;
  JLabel label1;

  public void init() {
   getContentPane().setLayout(new FlowLayout());
   //
   label1 = new JLabel("max 10 chars");
   textfield1 = new JTextField(15);
   getContentPane().add(label1);
   getContentPane().add(textfield1);
   textfield1.setDocument
    (new JTextFieldLimit(10));
   }
}
origin: chewiebug/GCViewer

/**
 * @param gcResource resource to be tracked
 */
public GCModelLoaderView(GCResource gcResource) {
  super(new BorderLayout());
  setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
  JPanel parserInfo = new JPanel(new FlowLayout(FlowLayout.LEFT));
  progressBar = new JProgressBar(0, 100);
  progressBar.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
  progressBar.setVisible(true);
  progressBar.setValue(0);
  progressBar.setStringPainted(true);
  cancelButton = new JButton(new SquareIcon());
  cancelButton.setActionCommand(CMD_CANCEL);
  cancelButton.addActionListener(this);
  messageLabel = new JLabel();
  messageLabel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
  messageLabel.setVisible(false);
  parserInfo.add(progressBar);
  parserInfo.add(cancelButton);
  parserInfo.add(messageLabel);
  add(parserInfo, BorderLayout.NORTH);
  JTextArea textArea = textAreaLogHandler.getTextArea();
  textArea.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
  JScrollPane textAreaScrollPane = new JScrollPane(textArea);
  textAreaScrollPane.setPreferredSize(new Dimension(700, 500));
  add(textAreaScrollPane, BorderLayout.CENTER);
  setGCResource(gcResource);
}
origin: stackoverflow.com

setLayout(new BorderLayout());
this.panel = new JPanel();
this.panel.setLayout(new FlowLayout());
add(panel, BorderLayout.CENTER);
JButton button = new JButton("CLICK HERE");
add(button, BorderLayout.SOUTH);
button.addActionListener(this);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(500, 500);
setVisible(true);
this.panel.add(new JButton("Button"));
this.panel.revalidate();
validate();
origin: chewiebug/GCViewer

Panel logoPanel = new Panel();
ImageIcon logoIcon = ImageHelper.loadImageIcon(LocalisationHelper.getString("about_dialog_image"));
JLabel la_icon = new JLabel(logoIcon);
la_icon.setBorder(new SoftBevelBorder(SoftBevelBorder.LOWERED));
logoPanel.add(la_icon);
JPanel versionPanel = new JPanel();
versionPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
versionPanel.setLayout(new GridBagLayout());
JLabel copyright = new JLabel("\u00A9" + " 2011-2017: Joerg Wuethrich and contributors", JLabel.CENTER);
JLabel contributorsLabel = new JLabel("contributors (alphabetically ordered):", JLabel.CENTER);
buttonPanel.setLayout(new FlowLayout(FlowLayout.CENTER));
if (UrlDisplayHelper.displayUrlIsSupported()) {
  JButton homePageButton = new JButton("Homepage");
  homePageButton.setActionCommand(ACTION_HOMEPAGE);
  homePageButton.addActionListener(this);
  buttonPanel.add(homePageButton);
okButton.addActionListener(this);
buttonPanel.add(okButton);
getContentPane().add("North", logoPanel);
getContentPane().add("Center", versionPanel);
getContentPane().add("South", buttonPanel);
pack();
setResizable(false);
java.awtFlowLayout

Most used methods

  • <init>
  • setAlignment
  • setVgap
  • setHgap
  • getVgap
  • setAlignOnBaseline
  • getHgap
  • addView
  • getAlignOnBaseline
  • getAlignment
  • layoutContainer
  • layoutContainer

Popular classes and methods

  • setRequestProperty (URLConnection)
    Sets the value of the specified request header field. The value will only be used by the current URL
  • getSupportFragmentManager (FragmentActivity)
  • addToBackStack (FragmentTransaction)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Graphics2D (java.awt)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)