Java 8 FlowLayout - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 FlowLayout class.

This code example shows how to use the following methods:
This code example shows how to use the following methods:setAlignment, setHgap, setVgap
	 
	public void init(int width, int height, Color background){
		Dimension masterDimension = new Dimension(width,height);
		this.setPreferredSize(masterDimension);
		 
		FlowLayout layout = new FlowLayout();
		layout.setVgap(0);
		layout.setHgap(2);
		layout.setAlignment(FlowLayout.RIGHT);
		EmptyBorder b = new EmptyBorder(2,0,0,30);
         this.setBorder(b);       
		this.setLayout(layout);
		this.setVisible(true);
		/*for(int i=0;i<this.buttonList.size();i++){ 
			Button b = buttonList.get(i); 
			//b.setSize(width/this.buttonList.size(),height); 
			this.add(b); 
		}*/ 
		this.setBackground(background);
		this.doLayout();
5
CodeRank
This code example shows how to use the following methods:
    } 
     
    /** Builds and lays out the GUI. */ 
    private void buildGUI() 
    { 
    	setLayout(new FlowLayout(FlowLayout.LEFT));
        add(buildControlsPane()); 
    } 
     
    /**  
     * Returns the name of the component.  
     * @see ControlPane#getPaneName() 
     */ 
    protected String getPaneName() { return "Device Settings"; }
 
    /** 
     * Returns the icon attached to the component. 
     * @see ControlPane#getPaneIcon() 
     */ 
    protected Icon getPaneIcon()
5
CodeRank
This code example shows how to use the following methods:
	private JTextArea textarea = null;
 
	public WebcamQRCodeExample() { 
		super(); 
 
		setLayout(new FlowLayout());
		setTitle("Read QR / Bar Code With Webcam");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 
		Dimension size = WebcamResolution.QVGA.getSize();
 
		webcam = Webcam.getWebcams().get(0);
		webcam.setViewSize(size);
 
		panel = new WebcamPanel(webcam);
		panel.setPreferredSize(size);
 
		textarea = new JTextArea();
		textarea.setEditable(false);
		textarea.setPreferredSize(size);
5
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
 */ 
public class StatusBar extends JPanel {
	private JLabel message;
 
	public StatusBar(Application app) {
		setLayout(new FlowLayout(FlowLayout.LEFT));
		setBorder(BorderFactory.createLoweredBevelBorder());
 
		message = new JLabel("", SwingConstants.LEFT);
		Font font = message.getFont();
		message.setFont(font.deriveFont(Font.PLAIN, (float) (font.getSize() * 0.90)));
		message.setForeground(Color.DARK_GRAY);
		add(message);
 
		message(app.getInfo().getName() + ", V" + app.getInfo().getVersion());
	} 
 
	public void message(String txt) {
		message.setText(txt);
	} 
5
CodeRank
This code example shows how to use the following methods:setVgap
	 * <code>true</code>. 
	 */ 
	public ShapeRenderer() 
	{ 
		label = new JLabel();
		FlowLayout layout = new FlowLayout(FlowLayout.CENTER);
		layout.setVgap(0);
		setLayout(layout);
		setOpaque(true);
		add(label);
	} 
	 
	/** 
	 * Overridden to set the icon corresponding to the shape. 
	 * @see TableCellRenderer#getTableCellRendererComponent(JTable, Object, 
	 *      boolean, boolean, int, int) 
	 */ 
	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column)
	{ 
5
CodeRank
This code example shows how to use the following methods:
		chckbxCaptureVideo.setSelected(true); 
		chckbxCaptureVideo.setBounds(6, 32, 150, 23); 
		contentPanel.add(chckbxCaptureVideo); 
		{ 
			JPanel buttonPane = new JPanel(); 
			buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); 
			getContentPane().add(buttonPane, BorderLayout.SOUTH); 
			{ 
				JButton okButton = new JButton("OK"); 
				okButton.setActionCommand("OK"); 
				okButton.addActionListener(new ActionListener(){ 
					@Override 
					public void actionPerformed(ActionEvent arg0) { 
						onOk(); 
					}}); 
				buttonPane.add(okButton); 
				getRootPane().setDefaultButton(okButton); 
			} 
			{ 
				JButton cancelButton = new JButton("Cancel"); 
5
CodeRank
This code example shows how to use the following methods:
 
      m_FormatText.getDocument().addDocumentListener(this);
      m_DefaultButton.addActionListener(this);
      m_ApplyButton.addActionListener(this);
 
      setLayout(new FlowLayout());
      add(new JLabel("ISO 8601 Date format"));
      add(m_FormatText);
      add(m_DefaultButton);
      add(m_ApplyButton);
    } 
 
    /** 
     * Responds to the user perfoming an action. 
     * 
     * @param e the action event that occured 
     */ 
    public void actionPerformed(ActionEvent e) {
      if (e.getSource() == m_DefaultButton)
	defaultFormat(); 
5
CodeRank
This code example shows how to use the following methods:
            UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel");
        } catch (Exception ex) {
            Logger.getLogger(SwingApplet.class.getName()).
                    log(Level.SEVERE, "Failed to apply Nimbus look and feel", ex);
        } 
        getContentPane().setLayout(new FlowLayout());
        button = new JButton("Hello, I'm a Swing Button!");
        getContentPane().add(button);
        getContentPane().doLayout();
    } 
 
    @Override 
    public void init() { 
        try { 
            SwingUtilities.invokeAndWait(new Runnable() {
 
                @Override 
                public void run() { 
                    initUI(); 
                } 
5
CodeRank
See Code Examples for Java 8 FlowLayout Methods: