Java 8 GridLayout - 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 GridLayout class.

This code example shows how to use the following methods:setColumns, setHgap, setRows, setVgap
		moduleEditPanel.initGui();
		return moduleEditPanel;
	} 
 
	private GridLayout createMappingPanelLayout() {
		GridLayout mappingPanelLayout = new GridLayout(2, 1);
		mappingPanelLayout.setColumns(1);
		mappingPanelLayout.setRows(2);
		mappingPanelLayout.setHgap(5);
		mappingPanelLayout.setVgap(5);
		return mappingPanelLayout;
	} 
 
	private JPanel createModulePanel() {
		modulePanel = new ModuleJPanel();
		modulePanel.initGui();
		return modulePanel;
	} 
 
	private JPanel createRightPanel() {
6
CodeRank
This code example shows how to use the following methods:setHgap, setRows
	 *  
	 * @return javax.swing.JPanel 
	 */ 
	private JPanel getJButtonGrid() {
		if (jButtonGrid == null) {
			GridLayout gridLayout = new GridLayout();
			gridLayout.setRows(1);
			gridLayout.setHgap(10);
			jButtonGrid = new JPanel();
			jButtonGrid.setBorder(BorderFactory.createEmptyBorder(10, 10, 10,
					10)); 
			jButtonGrid.setLayout(gridLayout);
			jButtonGrid.setBackground(Color.WHITE);
			jButtonGrid.add(getOkButton(), null);
		} 
		return jButtonGrid;
	} 
 
	/** 
	 * Initializes and returns Ok Button. 
6
CodeRank
This code example shows how to use the following methods:setColumns, setHgap, setRows, setVgap
			disableMoveLayerObjects(); 
		} 
	} 
 
	private GridLayout createButtonPanelLayout() {
		GridLayout buttonPanelLayout = new GridLayout(2, 2);
		buttonPanelLayout.setColumns(2);
		buttonPanelLayout.setHgap(5);
		buttonPanelLayout.setVgap(5);
		buttonPanelLayout.setRows(2);
		return buttonPanelLayout;
	} 
 
	public JPanel createInnerModulePanel() {
		JPanel innerModulePanel = new JPanel();
		BorderLayout innerModulePanelLayout = new BorderLayout();
		innerModulePanel.setLayout(innerModulePanelLayout);
		innerModulePanel.setBorder(BorderFactory
				.createTitledBorder(ServiceProvider.getInstance()
						.getLocaleService() 
6
CodeRank
This code example shows how to use the following methods:setHgap, setRows
	private JPanel getButtonPanel() {
		if (buttonPanel == null) {
			buttonPanel = new JPanel(new BorderLayout());
			buttonPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10,
					10)); 
			GridLayout gridLayout = new GridLayout();
			gridLayout.setRows(1);
			gridLayout.setHgap(10);
			JPanel panel = new JPanel(gridLayout);
			panel.add(getOkButton());
			buttonPanel.add(panel, BorderLayout.EAST);
		} 
		return buttonPanel;
	} 
 
	/** 
	 * Initializes and returns the Ok button in the dialog. 
	 */ 
	private JButton getOkButton() {
		if (okButton == null) {
6
CodeRank
This code example shows how to use the following methods:
      cpu = false;
    }     
 
    JFrame f = new JFrame();
    f.setSize(256, 256);
    f.setLayout(new GridLayout());
    f.add(new NewJPanel(cpu));
    f.setVisible(true);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  } 
} 
6
CodeRank
This code example shows how to use the following methods:
            helpWindow = new EscapeDialog(new Frame(),// independent frame to
                                                    // allow it to be overlaid 
                                                    // by the main frame 
                    JMeterUtils.getResString("help"),//$NON-NLS-1$ 
                    false); 
            helpWindow.getContentPane().setLayout(new GridLayout(1, 1));
            helpWindow.getContentPane().removeAll();
            helpWindow.getContentPane().add(scroller);
            ComponentUtil.centerComponentInWindow(helpWindow, 60);
        } 
        helpWindow.setVisible(true); // set the window visible immediately
        /* 
         * This means that a new page will be shown before rendering is complete, 
         * however the correct location will be displayed. 
         * Attempts to use a "page" PropertyChangeListener to detect when the page 
         * has been loaded failed to work any better.  
         */ 
        StringBuilder url=new StringBuilder();
        if (e.getSource() instanceof String[]) {
            String[] source = (String[]) e.getSource();
5
CodeRank
This code example shows how to use the following methods:
            helpWindow = new JDialog(new Frame(),// independent frame to
                                                    // allow it to be overlaid 
                                                    // by the main frame 
                    JMeterUtils.getResString("help"),//$NON-NLS-1$ 
                    false); 
            helpWindow.getContentPane().setLayout(new GridLayout(1, 1));
            ComponentUtil.centerComponentInWindow(helpWindow, 60);
        } 
        helpWindow.getContentPane().removeAll();
        helpWindow.getContentPane().add(scroller);
        helpWindow.setVisible(true);
        if (e.getSource() instanceof String[]) {
            String[] source = (String[]) e.getSource();
            resetPage(source[0]);
            helpDoc.scrollToReference(source[1]);
        } else { 
            resetPage(HELP_PAGE);
            helpDoc.scrollToReference(ReportGuiPackage.getInstance().getTreeListener().getCurrentNode().getDocAnchor());
 
        } 
5
CodeRank
This code example shows how to use the following methods:setHgap, setVgap
 * @author Mathieu Bastian 
 */ 
public class WorkspaceUISelectorPopupContent extends JPanel {
 
    public WorkspaceUISelectorPopupContent() { 
        GridLayout grid = new GridLayout(0, 1);
        grid.setHgap(0);
        grid.setVgap(0);
        setLayout(grid);
        setBorder(BorderFactory.createEmptyBorder());
    } 
 
    public void addListComponent(JComponent lst) {
        if (getComponentCount() > 0) {
            JComponent previous = (JComponent) getComponent(getComponentCount() - 1);
            previous.setBorder(new BottomLineBorder());
        } 
        lst.setBorder(BorderFactory.createEmptyBorder());
        add(lst);
    } 
5
CodeRank
This code example shows how to use the following methods:
        setContentPane(createContentPane());
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    } 
 
    private Container createContentPane() {
        JPanel contentPane = new JPanel(new GridLayout(0, 1));
        contentPane.add(new JLabel("Which GUI example do you want to see?"));
 
//        contentPane.add(new JButton(new AbstractAction("SudokuExample") { 
//            public void actionPerformed(ActionEvent e) { 
//                SudokuExample.main(new String[0]); 
//            } 
//        })); 
         
        contentPane.add(new JLabel("Which output example do you want to see?"));
 
//        contentPane.add(new JButton(new AbstractAction("HelloWorldExample") { 
//            public void actionPerformed(ActionEvent e) { 
//                HelloWorldExample.main(new String[0]); 
//            } 
5
CodeRank
This code example shows how to use the following methods:setHgap, setVgap
		this.setSize(700, 190);
		this.setVisible(true);
	} 
	 
	private GridLayout getGridLayout(int rows, int columns) {
		GridLayout gridLayout = new GridLayout(rows, columns);
		gridLayout.setHgap(5);
		gridLayout.setVgap(5);
		return gridLayout;
	} 
	 
	private void createInnerPanel() { 
		this.addParentModule();
		this.addModuleValues();
		this.addModuleDescriptionTextArea();
		this.addModuleTypeComboBox();
		this.addButtons();
		this.setVisibles();
	} 
	 
5
CodeRank
See Code Examples for Java 8 GridLayout Methods: