private void configureHorizontalLayout(GroupLayout groupLayout) { groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addContainerGap() .addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false) .addComponent(tagEditLbl, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(editTagLbl, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(projectLbl, GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE)) .addGap(18) .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addComponent(saveBtn, GroupLayout.PREFERRED_SIZE, 101, GroupLayout.PREFERRED_SIZE) .addGap(47) .addComponent(removeBtn, GroupLayout.PREFERRED_SIZE, 119, GroupLayout.PREFERRED_SIZE)) .addComponent(projectBox, 0, 282, Short.MAX_VALUE) .addComponent(editTagTxtField, GroupLayout.DEFAULT_SIZE, 282, Short.MAX_VALUE) .addComponent(tagSelectBox, 0, 352, Short.MAX_VALUE)) .addContainerGap()) ); }
private void configureVerticalLayout(GroupLayout groupLayout) { groupLayout.setVerticalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addContainerGap() .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(projectLbl, GroupLayout.DEFAULT_SIZE, 37, Short.MAX_VALUE) .addComponent(projectBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED) .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(editTagLbl, GroupLayout.PREFERRED_SIZE, 37, GroupLayout.PREFERRED_SIZE) .addComponent(tagSelectBox, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(tagEditLbl, GroupLayout.PREFERRED_SIZE, 29, GroupLayout.PREFERRED_SIZE) .addComponent(editTagTxtField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(18) .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(saveBtn, GroupLayout.PREFERRED_SIZE, 39, GroupLayout.PREFERRED_SIZE) .addComponent(removeBtn, GroupLayout.PREFERRED_SIZE, 38, GroupLayout.PREFERRED_SIZE)) .addGap(11)) ); }
public CollisionBoxPanel() { TitledBorder border = new TitledBorder(new LineBorder(new Color(128, 128, 128)), Resources.get("panel_collisionBox"), TitledBorder.LEADING, TitledBorder.TOP, null, null); border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD)); setBorder(border); chckbxIsObstacle = new JCheckBox(Resources.get("panel_isObstacle")); GroupLayout groupLayout = new GroupLayout(this); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addContainerGap() .addComponent(chckbxIsObstacle, GroupLayout.PREFERRED_SIZE, 108, GroupLayout.PREFERRED_SIZE) .addContainerGap(322, Short.MAX_VALUE))); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addComponent(chckbxIsObstacle, GroupLayout.PREFERRED_SIZE, 21, GroupLayout.PREFERRED_SIZE) .addContainerGap(258, Short.MAX_VALUE))); setLayout(groupLayout); this.setupChangedListeners(); }
private GroupLayout.ParallelGroup getHorizontalGroup (GroupLayout layout, boolean hasPrimary, boolean hasRequired) { GroupLayout.ParallelGroup res = layout.createParallelGroup (Alignment.LEADING); if (hasPrimary) { res.addGroup (Alignment.TRAILING, layout.createSequentialGroup () .addGroup (layout.createParallelGroup (Alignment.TRAILING) .addGroup (Alignment.LEADING, layout.createSequentialGroup () .addGap (49, 49, 49) .addComponent (tpPrimaryPlugins, GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE)) .addGroup (Alignment.LEADING, layout.createSequentialGroup () .addContainerGap () .addComponent (tpPrimaryTitle, GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE))) .addContainerGap ()); } if (hasRequired) { res.addGroup (Alignment.TRAILING, layout.createSequentialGroup () .addGroup (layout.createParallelGroup (Alignment.TRAILING) .addGroup (Alignment.LEADING, layout.createSequentialGroup () .addGap (49, 49, 49) .addComponent (tpDependingPlugins, GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE)) .addGroup (Alignment.LEADING, layout.createSequentialGroup () .addContainerGap () .addComponent (tpDependingTitle, GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE))) .addContainerGap ()); } return res; }
private void initializeGroupLayout() { GroupLayout groupLayout = new GroupLayout(contentPane); groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout .createSequentialGroup() .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup().addContainerGap() .addComponent(this.btnContratacao, GroupLayout.DEFAULT_SIZE, 239, Short.MAX_VALUE)) .addGroup(groupLayout.createSequentialGroup().addGap(79).addComponent(this.btnCadastro, GroupLayout.PREFERRED_SIZE, 119, GroupLayout.PREFERRED_SIZE))) .addContainerGap()) .addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup().addContainerGap(45, Short.MAX_VALUE) .addComponent(this.lblTitle, GroupLayout.PREFERRED_SIZE, 178, GroupLayout.PREFERRED_SIZE) .addGap(40))); groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout .createSequentialGroup().addGap(33) .addComponent(this.lblTitle, GroupLayout.PREFERRED_SIZE, 41, GroupLayout.PREFERRED_SIZE).addGap(39) .addComponent(btnCadastro, GroupLayout.PREFERRED_SIZE, 41, GroupLayout.PREFERRED_SIZE).addGap(33) .addComponent(this.btnContratacao, GroupLayout.PREFERRED_SIZE, 35, GroupLayout.PREFERRED_SIZE) .addContainerGap(47, Short.MAX_VALUE))); this.contentPane.setLayout(groupLayout); }
/** * Create the panel. */ public TextPanel(String text) { JLabel lblUpdateChangelog = new JLabel("Update description/change-log:"); JScrollPane scrollPane = new JScrollPane(); JLabel lblDoYouWant = new JLabel("Do you want to install this update?"); lblDoYouWant.setFont(new Font("Tahoma", Font.PLAIN, 15)); lblDoYouWant.setHorizontalAlignment(SwingConstants.CENTER); GroupLayout groupLayout = new GroupLayout(this); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(Alignment.TRAILING) .addGroup(groupLayout.createSequentialGroup() .addContainerGap() .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 430, Short.MAX_VALUE) .addComponent(lblUpdateChangelog, GroupLayout.DEFAULT_SIZE, 430, Short.MAX_VALUE) .addComponent(lblDoYouWant, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 430, Short.MAX_VALUE)) .addContainerGap()) ); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addContainerGap() .addComponent(lblUpdateChangelog) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 249, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(lblDoYouWant) .addContainerGap()) ); JTextArea textArea = new JTextArea(); scrollPane.setViewportView(textArea); setLayout(groupLayout); textArea.setEditable(false); textArea.setText(text); }
private void grlay(final JPanel panel) { final GroupLayout layout = new GroupLayout(panel); // panel.setBorder(BorderFactory.createTitledBorder("Nastvit nickVzorky popisků: " + SestavovacPopisku.getNahrazovaceDisplay())); panel.setLayout(layout); layout.setAutoCreateGaps(true); layout.setAutoCreateContainerGaps(true); // panel.add(jKesPatternEdit); // panel.add(jWaymarkPatternEdit); // panel.add(jCgpPatternEdit); // panel.add(jSimplewaypontPatternEdit); layout.setHorizontalGroup(layout.createParallelGroup(Alignment.CENTER).addGroup(layout.createParallelGroup() // hroup .addComponent(jZpravy).addGroup(layout.createSequentialGroup().addComponent(jPredchozi).addComponent(jDalsi).addComponent(jPrecteno)))); layout.setVerticalGroup(layout.createSequentialGroup() // hroup .addComponent(jZpravy).addGroup(layout.createParallelGroup().addComponent(jDalsi).addComponent(jPredchozi).addComponent(jPrecteno))); }
private void initComponents() { digitalPanel = new JPanel(); analogPanel = new JPanel(); GroupLayout groupLayout = new GroupLayout(this); groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addComponent(analogPanel, GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE).addComponent(digitalPanel, GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE)) .addGap(0))); groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup().addComponent(analogPanel, GroupLayout.DEFAULT_SIZE, 91, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED).addComponent(digitalPanel, GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE) .addGap(0))); setLayout(groupLayout); }
/** * Create the frame. */ public Log() { setBounds(100, 100, 319, 290); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); JScrollPane scrollPane = new JScrollPane(); GroupLayout gl_contentPane = new GroupLayout(contentPane); gl_contentPane.setHorizontalGroup( gl_contentPane.createParallelGroup(Alignment.LEADING) .addComponent(scrollPane, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE) ); gl_contentPane.setVerticalGroup( gl_contentPane.createParallelGroup(Alignment.LEADING) .addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE) ); textArea = new JTextArea(); scrollPane.setViewportView(textArea); textArea.setLineWrap(true); contentPane.setLayout(gl_contentPane); }
/** Build the dialog. */ public BackgroundProgress() { setTitle("Work in background"); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); setModal(true); label = new JLabel("Working..."); progress = new JProgressBar(); progress.setIndeterminate(true); Container c = getContentPane(); GroupLayout gl = new GroupLayout(c); c.setLayout(gl); gl.setAutoCreateContainerGaps(true); gl.setAutoCreateGaps(true); gl.setHorizontalGroup(gl.createParallelGroup(Alignment.CENTER) .addComponent(label).addComponent(progress)); gl.setVerticalGroup(gl.createSequentialGroup().addComponent(label).addComponent(progress)); pack(); setResizable(false); }
public JKeyBindingPanel(FrameKeyBindings parent, KeyBinding.Type type, KeyBinding binding) { this.parent = parent; JLabel label = new JLabel(" " + type.toString()); label.setPreferredSize(new Dimension(5000, 50)); label.setBorder(BorderFactory.createLineBorder(Color.gray)); btn = new JKeyBindingButton(this, type, binding); GroupLayout groupLayout = new GroupLayout(this); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addComponent(label, GroupLayout.PREFERRED_SIZE, 152, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(btn, GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE)) ); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addComponent(label, GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE) .addComponent(btn, GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE) ); setLayout(groupLayout); }
public JPanel getPanelPregunta() { if (panelPregunta == null) { panelPregunta = new JPanel(); panelPregunta.setBorder(new EmptyBorder(4, 6, 4, 6)); GroupLayout gl_panelPregunta = new GroupLayout(panelPregunta); gl_panelPregunta .setHorizontalGroup(gl_panelPregunta.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelPregunta.createSequentialGroup() .addComponent(getPanelLetra(), GroupLayout.PREFERRED_SIZE, 58, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(getScrollPane(), GroupLayout.DEFAULT_SIZE, 403, Short.MAX_VALUE) .addGap(1))); gl_panelPregunta.setVerticalGroup(gl_panelPregunta.createParallelGroup(Alignment.LEADING) .addGroup(gl_panelPregunta.createSequentialGroup() .addGroup(gl_panelPregunta.createParallelGroup(Alignment.LEADING) .addComponent(getPanelLetra(), GroupLayout.PREFERRED_SIZE, 48, GroupLayout.PREFERRED_SIZE) .addComponent(getScrollPane(), GroupLayout.PREFERRED_SIZE, 48, GroupLayout.PREFERRED_SIZE)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panelPregunta.setLayout(gl_panelPregunta); } return panelPregunta; }
private void initialize() { setResizable(false); setTitle("Instrucciones de juego"); setBounds(100, 100, 450, 300); GroupLayout groupLayout = new GroupLayout(getContentPane()); groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addComponent(getTextPane(), GroupLayout.DEFAULT_SIZE, 444, Short.MAX_VALUE)); groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addComponent(getTextPane(), GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)); getContentPane().setLayout(groupLayout); // Centrar la ventana Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension windowSize = this.getSize(); if (windowSize.height > screenSize.height) windowSize.height = screenSize.height; if (windowSize.width > screenSize.width) windowSize.width = screenSize.width; setLocation((screenSize.width - windowSize.width) / 2, (screenSize.height - windowSize.height) / 2); setIconImage(new ImageIcon(MenuPrincipal.class.getResource("/packRecursos/icon.jpg")).getImage()); }
public UIDefaultsEditor() { renderer = new UIDefaultsRenderer(); renderer.addMouseListener(this); popup = new JPopupMenu(); popup.setLayout(new BorderLayout()); JButton ok = new JButton(OK); ok.addActionListener(this); JButton cancel = new JButton(CANCEL); cancel.addActionListener(this); JPanel buttons = new JPanel(null); GroupLayout layout = new GroupLayout(buttons); buttons.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(Alignment.CENTER, true) .addGroup(layout.createSequentialGroup() .addGap(8).addComponent(ok).addGap(5).addComponent(cancel).addGap(8)) .addGap(100, 100, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createBaselineGroup(false, true) .addComponent(ok).addComponent(cancel)); layout.linkSize(SwingUtilities.HORIZONTAL, ok, cancel); popup.add(buttons, BorderLayout.SOUTH); }
@SuppressWarnings("unused") BooleanChooser() { tru = new JRadioButton(Boolean.TRUE.toString()); tru.setFont(UIDefaultsRenderer.BOOLEAN_FONT); fal = new JRadioButton(Boolean.FALSE.toString()); fal.setFont(UIDefaultsRenderer.BOOLEAN_FONT); ButtonGroup group = new ButtonGroup(); group.add(tru); group.add(fal); pane = new JPanel(null); GroupLayout layout = new GroupLayout(pane); pane.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(Alignment.CENTER, true) .addGap(100, 100, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addGap(8) .addGroup(layout.createParallelGroup(Alignment.LEADING, false) .addComponent(tru).addComponent(fal)) .addGap(8))); layout.setVerticalGroup(layout.createSequentialGroup() .addGap(2).addComponent(tru).addComponent(fal).addGap(4)); }
private void initialize() { setBorder(new TitledBorder(null, "RS422", TitledBorder.LEADING, TitledBorder.TOP, null, null)); GroupLayout groupLayout = new GroupLayout(this); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addContainerGap() .addComponent(getLblPort()) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(getComboBox(), 0, 404, Short.MAX_VALUE) .addContainerGap()) ); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addContainerGap() .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(getLblPort()) .addComponent(getComboBox(), GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addContainerGap(280, Short.MAX_VALUE)) ); setLayout(groupLayout); }
@Override public Component getCustomEditor(){ final GLFrameBuffer source = (GLFrameBuffer)getSource(); final JPanel result = new JPanel(); result.setLayout(new BoxLayout(result,BoxLayout.PAGE_AXIS)); result.setAlignmentX(Component.LEFT_ALIGNMENT); for(GLTexture tex:source.getAttached2DDrawTextures()){ final java.beans.PropertyEditor ed = TRBeanUtils.getDefaultPropertyEditor(tex); final JLabel label = new JLabel(tex.getDebugName(),SwingConstants.LEFT); //Does this align it left? label.setHorizontalAlignment(SwingConstants.LEFT); //Nope. How about this one? label.setAlignmentX(Component.LEFT_ALIGNMENT); //Still nope. Ok, how about this? label.setHorizontalTextPosition(JLabel.LEFT); //Nope!!! result.add(label,Alignment.LEADING); final JComponent cEd = (JComponent)ed.getCustomEditor(); cEd.setAlignmentX(Component.LEFT_ALIGNMENT); result.add(cEd); }//end for(textures) return result; }
public StaticShadowPanel() { TitledBorder border = new TitledBorder(new LineBorder(new Color(128, 128, 128)), Resources.get("panel_staticShadow"), TitledBorder.LEADING, TitledBorder.TOP, null, null); border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD)); setBorder(border); JLabel lblShadowType = new JLabel(Resources.get("panel_shadowType")); comboBoxShadowType = new JComboBox<>(); comboBoxShadowType.setModel(new DefaultComboBoxModel<StaticShadowType>(StaticShadowType.values())); GroupLayout groupLayout = new GroupLayout(this); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addContainerGap() .addComponent(lblShadowType, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE) .addGap(10) .addGroup(groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addComponent(comboBoxShadowType, 0, 95, Short.MAX_VALUE) .addGap(4))))); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(comboBoxShadowType, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE) .addComponent(lblShadowType, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.UNRELATED) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); setLayout(groupLayout); this.setupChangedListeners(); }
public EmitterPanel() { TitledBorder border = new TitledBorder(new LineBorder(new Color(128, 128, 128)), Resources.get("panel_emitter"), TitledBorder.LEADING, TitledBorder.TOP, null, null); border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD)); setBorder(border); JLabel lblShadowType = new JLabel(Resources.get("panel_emitterType")); textFieldType = new JTextField(); textFieldType.setColumns(10); GroupLayout groupLayout = new GroupLayout(this); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addContainerGap() .addComponent(lblShadowType, GroupLayout.PREFERRED_SIZE, 51, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(textFieldType, GroupLayout.DEFAULT_SIZE, 95, Short.MAX_VALUE) .addContainerGap())); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(lblShadowType, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE) .addComponent(textFieldType, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE)) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); setLayout(groupLayout); this.setupChangedListeners(); }
public GridEditPanel(int rasterSize) { JLabel lblSize = new JLabel("size (px)"); lblSize.setFont(Program.TEXT_FONT.deriveFont(Font.BOLD).deriveFont(10f)); textField = new JFormattedTextField(NumberFormat.getIntegerInstance()); textField.setText("16"); textField.setFont(Program.TEXT_FONT.deriveFont(10f)); textField.setColumns(10); textField.setValue(rasterSize); GroupLayout groupLayout = new GroupLayout(this); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addContainerGap() .addComponent(lblSize, GroupLayout.PREFERRED_SIZE, 44, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(textField, GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE) .addGap(34))); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addContainerGap() .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(lblSize, GroupLayout.PREFERRED_SIZE, 13, GroupLayout.PREFERRED_SIZE) .addComponent(textField, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE)) .addContainerGap(46, Short.MAX_VALUE))); setLayout(groupLayout); }
/** * Create the dialog. */ public ProgressDialog() { setBounds(100, 100, 450, 141); getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); lblStatus = new JLabel("Status: Initializing"); lblStatus.setFont(new Font("Tahoma", Font.PLAIN, 12)); pb = new JProgressBar(); GroupLayout gl_contentPanel = new GroupLayout(contentPanel); gl_contentPanel .setHorizontalGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING).addGroup(Alignment.TRAILING, gl_contentPanel.createSequentialGroup().addContainerGap() .addGroup(gl_contentPanel.createParallelGroup(Alignment.TRAILING) .addComponent(pb, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 404, Short.MAX_VALUE) .addComponent(lblStatus, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 404, Short.MAX_VALUE)) .addContainerGap())); gl_contentPanel.setVerticalGroup(gl_contentPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_contentPanel.createSequentialGroup().addContainerGap().addComponent(lblStatus) .addPreferredGap(ComponentPlacement.RELATED).addComponent(pb, GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE))); contentPanel.setLayout(gl_contentPanel); { JPanel buttonPane = new JPanel(); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); getContentPane().add(buttonPane, BorderLayout.SOUTH); { JButton cancelButton = new JButton("Cancel"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dispose(); } }); cancelButton.setActionCommand("Cancel"); buttonPane.add(cancelButton); } } }
private void layoutComponents() { JScrollPane printTextScrollPane = new JScrollPane(appendTextInput); printTextScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); JSeparator separator1 = new JSeparator(); JScrollPane readLineTextScrollPane = new JScrollPane(readLineOutput); readLineTextScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); JSeparator separator2 = new JSeparator(); JScrollPane consoleScrollPane = new JScrollPane(consoleText); consoleScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); GroupLayout groupLayout = new GroupLayout(this); groupLayout.setAutoCreateContainerGaps(true); groupLayout.setAutoCreateGaps(true); groupLayout.setHorizontalGroup(groupLayout.createParallelGroup().addComponent(printTextScrollPane) .addComponent(appendText, Alignment.TRAILING).addComponent(separator1) .addComponent(readLine, Alignment.TRAILING).addComponent(readLineTextScrollPane) .addComponent(separator2).addComponent(consoleScrollPane)); groupLayout.setVerticalGroup(groupLayout.createSequentialGroup() .addComponent(printTextScrollPane, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(appendText) .addComponent(separator1, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(readLine) .addComponent(readLineTextScrollPane, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(separator2, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(consoleScrollPane)); setLayout(groupLayout); }
/** * Initialize the contents of the frame. */ private void initialize() { frmMiPrimerFrame = new JFrame(); frmMiPrimerFrame.setTitle("Mi Primer Frame"); frmMiPrimerFrame.setBounds(100, 100, 686, 472); frmMiPrimerFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); desktopPane = new JDesktopPane(); GroupLayout groupLayout = new GroupLayout(frmMiPrimerFrame.getContentPane()); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addContainerGap() .addComponent(desktopPane, GroupLayout.DEFAULT_SIZE, 206, Short.MAX_VALUE) .addContainerGap()) ); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addContainerGap() .addComponent(desktopPane, GroupLayout.DEFAULT_SIZE, 234, Short.MAX_VALUE) .addContainerGap()) ); frmMiPrimerFrame.getContentPane().setLayout(groupLayout); JMenuBar menuBar = new JMenuBar(); frmMiPrimerFrame.setJMenuBar(menuBar); JMenu mnArchivo = new JMenu("Archivo"); menuBar.add(mnArchivo); JMenuItem mntmNuevoSaludo = new JMenuItem("Nuevo Saludo"); mntmNuevoSaludo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { abrirNuevoSaludo(); } }); mnArchivo.add(mntmNuevoSaludo); }
private void grlay(final JPanel panel) { final GroupLayout layout = new GroupLayout(panel); // panel.setBorder(BorderFactory.createTitledBorder("Nastvit nickVzorky popisků: " + SestavovacPopisku.getNahrazovaceDisplay())); panel.setLayout(layout); layout.setAutoCreateGaps(true); layout.setAutoCreateContainerGaps(true); // panel.add(jKesPatternEdit); // panel.add(jWaymarkPatternEdit); // panel.add(jCgpPatternEdit); // panel.add(jSimplewaypontPatternEdit); layout.setHorizontalGroup(layout.createParallelGroup(Alignment.CENTER) .addGroup(layout.createSequentialGroup() // hroup .addGroup(layout.createParallelGroup() // h1 .addComponent(jNickNameLabel).addComponent(jNickIdLabel)) .addGroup(layout.createParallelGroup() // h1 .addComponent(jNickName).addComponent(jNickId))) .addComponent(jUlozit)); layout.setVerticalGroup(layout.createSequentialGroup() // hroup .addGroup(layout.createParallelGroup() // h1 .addComponent(jNickNameLabel).addComponent(jNickName)) .addGroup(layout.createParallelGroup() // h1 .addComponent(jNickIdLabel).addComponent(jNickId)) .addGroup(layout.createParallelGroup() // h1 .addComponent(jUlozit))); }
/** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { flagsScrollPane = new JScrollPane(); flagsTable = new JTable(); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); flagsTable.setModel(new DefaultTableModel( new Object [][] { }, new String [] { } )); flagsScrollPane.setViewportView(flagsTable); GroupLayout layout = new GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(flagsScrollPane, GroupLayout.DEFAULT_SIZE, 480, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(Alignment.LEADING) .addGroup(Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap() .addComponent(flagsScrollPane, GroupLayout.DEFAULT_SIZE, 689, Short.MAX_VALUE)) ); pack(); }
/** * Create the frame. * @throws IOException */ public TraceabilityMatrixViewHandler() throws IOException { setTitle("ReqTracker-Requirement Traceability Matrix"); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); setBounds(100, 100, 1157, 679); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); scrollPane = new JScrollPane(); GroupLayout gl_contentPane = new GroupLayout(contentPane); gl_contentPane.setHorizontalGroup( gl_contentPane.createParallelGroup(Alignment.LEADING) .addGroup(gl_contentPane.createSequentialGroup() .addContainerGap() .addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 1094, GroupLayout.PREFERRED_SIZE) .addContainerGap(16, Short.MAX_VALUE)) ); gl_contentPane.setVerticalGroup( gl_contentPane.createParallelGroup(Alignment.LEADING) .addGroup(gl_contentPane.createSequentialGroup() .addContainerGap() .addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 578, GroupLayout.PREFERRED_SIZE) .addContainerGap(19, Short.MAX_VALUE)) ); contentPane.setLayout(gl_contentPane); }
private JPanel createButtonPanel() { JPanel panel = new JPanel(); GroupLayout layout = new GroupLayout(panel); panel.setLayout(layout); upButton = new JButton("Up"); downButton = new JButton("Down"); renameButton = new JButton("Rename"); deleteButton = new JButton("Delete"); upButton .addActionListener(e -> swapSelectedWith(i -> i - 1)); downButton.addActionListener(e -> swapSelectedWith(i -> i + 1)); renameButton.addActionListener(e -> rename()); deleteButton.addActionListener(e -> delete()); layout.setHorizontalGroup( layout.createParallelGroup(Alignment.CENTER) .addComponent(upButton) .addComponent(downButton) .addComponent(renameButton) .addComponent(deleteButton)); layout.setVerticalGroup( layout.createSequentialGroup() .addComponent(upButton) .addComponent(downButton) .addGap(15) .addComponent(renameButton) .addComponent(deleteButton)); layout.linkSize(upButton, downButton, renameButton, deleteButton); return panel; }
/** * Constructor. Sets the dialog's title. * @param title the title * @param owner the owner */ public ProgressFrame(String title, Window owner) { super(owner, title); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); setModalityType(ModalityType.APPLICATION_MODAL); bar = new JProgressBar(); label = new JLabel(); cancel = new JButton("Cancel"); cancel.addActionListener(this); Container c = getContentPane(); GroupLayout gl = new GroupLayout(c); c.setLayout(gl); gl.setAutoCreateContainerGaps(true); gl.setAutoCreateGaps(true); gl.setHorizontalGroup( gl.createParallelGroup(Alignment.CENTER) .addComponent(bar) .addComponent(label) .addComponent(cancel) ); gl.setVerticalGroup( gl.createSequentialGroup() .addComponent(bar) .addComponent(label) .addComponent(cancel) ); setSize(350, 150); setLocationRelativeTo(owner); }
/** * Construct the box with the given label and editor component. * @param displayText the exact text to display * @param component the component */ protected CEValueBox(String displayText, C component) { label = new JLabel(displayText); this.component = component; valid = new JLabel(); valid.setPreferredSize(new Dimension(20, 20)); GroupLayout gl = new GroupLayout(this); setLayout(gl); gl.setHorizontalGroup( gl.createSequentialGroup() .addComponent(label) .addGap(10) .addComponent(component) .addGap(5) .addComponent(valid, 20, 20, 20) .addGap(20) ); gl.setVerticalGroup( gl.createParallelGroup(Alignment.BASELINE) .addComponent(label) .addComponent(component, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(valid, 20, 20, 20) ); gl.setHonorsVisibility(valid, false); }
public JValidatedInputDialog(final Program program, final JDialogCentered jDialogCentered) { super(program, "", jDialogCentered.getDialog()); ListenerClass listener = new ListenerClass(); jMessage = new JTextArea(); jMessage.setFocusable(false); jMessage.setEditable(false); jMessage.setBackground(getDialog().getBackground()); jMessage.setFont(getDialog().getFont()); jName = new JTextField(); jOK = new JButton(DialoguesProfiles.get().ok()); jOK.setActionCommand(InputDialogAction.OK.name()); jOK.addActionListener(listener); jCancel = new JButton(DialoguesProfiles.get().cancel()); jCancel.setActionCommand(InputDialogAction.CANCEL.name()); jCancel.addActionListener(listener); layout.setHorizontalGroup( layout.createParallelGroup() .addComponent(jMessage, 250, 250, 250) .addComponent(jName, 250, 250, 250) .addGroup(Alignment.TRAILING, layout.createSequentialGroup() .addComponent(jOK, Program.getButtonsWidth(), Program.getButtonsWidth(), Program.getButtonsWidth()) .addComponent(jCancel, Program.getButtonsWidth(), Program.getButtonsWidth(), Program.getButtonsWidth()) ) ); layout.setVerticalGroup( layout.createSequentialGroup() .addComponent(jMessage) .addComponent(jName, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight()) .addGroup(layout.createParallelGroup() .addComponent(jOK, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight()) .addComponent(jCancel, Program.getButtonsHeight(), Program.getButtonsHeight(), Program.getButtonsHeight()) ) ); }
/** * Create the dialog. */ public DrawingPropertiesDialog(/*Frame parent, boolean modal, */) { // drawing = d; setBounds(100, 100, 454, 585); JScrollPane scrollPane = new JScrollPane(); GroupLayout gl_contentPanel = new GroupLayout(this); gl_contentPanel.setHorizontalGroup( gl_contentPanel.createParallelGroup(Alignment.LEADING) .addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 438, Short.MAX_VALUE) ); gl_contentPanel.setVerticalGroup( gl_contentPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_contentPanel.createSequentialGroup() .addContainerGap() .addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE) .addContainerGap()) ); tableRenderer = new DefaultTableRenderer(new DrawingCellComponentProvider()); cellEditor = new DrawingTableCellEditor(); table = new JXTable(); // table.setHighlighters(HighlighterFactory.createSimpleStriping()); table.addHighlighter(new ColorHighlighter(HighlightPredicate.ROLLOVER_ROW, Color.BLACK, Color.WHITE)); table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); cellEditor.addCellEditorListener(table); scrollPane.setViewportView(table); setLayout(gl_contentPanel); setName("Properties"); }
/** * Create the panel. */ public TableCellPanel(Icon buttonIcon) { setMinimumSize(new Dimension(1, 1)); setAlignmentY(Component.TOP_ALIGNMENT); setAlignmentX(Component.LEFT_ALIGNMENT); setBackground(Color.WHITE); btnNewButton = new JButton(""); btnNewButton.setIcon(buttonIcon); btnNewButton.setMinimumSize(new Dimension(107, 1)); lblNewLabel = new JTextField(); lblNewLabel.setFont(new Font("Droid Sans", Font.PLAIN, 11)); lblNewLabel.setMinimumSize(new Dimension(4, 1)); GroupLayout groupLayout = new GroupLayout(this); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(Alignment.TRAILING) .addGroup(groupLayout.createSequentialGroup() .addComponent(lblNewLabel, GroupLayout.DEFAULT_SIZE, 552, Short.MAX_VALUE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(btnNewButton, GroupLayout.PREFERRED_SIZE, 24, GroupLayout.PREFERRED_SIZE)) ); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addComponent(btnNewButton, GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE) .addComponent(lblNewLabel, GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE) ); setLayout(groupLayout); }
public FrameKeyBindings() { setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setTitle("Key bindings"); setIconImage(IconUtils.getIcon("keys").getImage()); setBounds(100, 100, 450, 300); bindingsPanel = new JPanel(); bindingsPanel.setLayout(null); JScrollPane scrollPane = new JScrollPane(); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scrollPane.setViewportView(bindingsPanel); GroupLayout groupLayout = new GroupLayout(getContentPane()); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 434, Short.MAX_VALUE) ); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE) .addGap(39)) ); getContentPane().setLayout(groupLayout); for (int i = 0; i < KeyBinding.Type.values().length; i++) { KeyBinding.Type type = KeyBinding.Type.values()[i]; JKeyBindingPanel panel = new JKeyBindingPanel(this, type, KeyBindings.KEYBINDINGS.get(type)); panels.add(panel); panel.setBounds(10, 10 + i * 30, getWidth() - 50, 25); bindingsPanel.add(panel); } bindingsPanel.setPreferredSize(new Dimension(0, 35 + KeyBinding.Type.values().length * 30)); }
public LocalizedStringField(boolean doNotUseCurrent) { this.doNotUseCurrent = doNotUseCurrent; textField = new BnTextField(); textField.setColumns(10); textField.setModelProvider(localProvider); textField.setPath(new Path("string")); JButton editButton = GuiComponentUtils.createButton(GuiIcon.LOCALIZATION, 2); GroupLayout groupLayout = new GroupLayout(this); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(Alignment.TRAILING, groupLayout.createSequentialGroup() .addComponent(textField, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(editButton)) ); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createParallelGroup(Alignment.CENTER) .addComponent(editButton) .addComponent(textField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) ); setLayout(groupLayout); editButton.addActionListener(evt -> { if (editDialog == null) { editDialog = new EditLocalizedStringDialog(GuiComponentUtils.getWindow(LocalizedStringField.this), true); editDialog.setModelProvider(localProvider); editDialog.setPath(new Path("this")); editDialog.pack(); } editDialog.setLocation(editButton.getLocationOnScreen()); editDialog.setVisible(true); }); }
private void initialize() { CompoundBorder border = new CompoundBorder(new TitledBorder( _("Stager working directory")), new EmptyBorder(3, 3, 3, 3)); setBorder(border); GroupLayout layout = new GroupLayout(this); this.setLayout(layout); layout.setAutoCreateContainerGaps(false); layout.setAutoCreateGaps(true); JLabel directoryLabel = new JLabel(_("Working directory")); GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup(); hGroup.addGroup(layout.createParallelGroup().addComponent( directoryLabel)); hGroup.addGroup(layout.createParallelGroup().addComponent( getDirectoryTextField())); hGroup.addGroup(layout.createParallelGroup().addComponent( getChooseDirectoryButton())); layout.setHorizontalGroup(hGroup); GroupLayout.SequentialGroup vGroup = layout.createSequentialGroup(); vGroup.addGroup(layout.createParallelGroup(Alignment.BASELINE) .addComponent(directoryLabel) .addComponent(getDirectoryTextField()) .addComponent(getChooseDirectoryButton())); layout.setVerticalGroup(vGroup); }
public RechercheInfo(){ setBounds(100, 100, 600, 500); getContentPane().setLayout(new BorderLayout()); contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(contentPanel, BorderLayout.CENTER); JEditorPane editorPane = new JEditorPane(); editorPane.setEditable(false); editorPane.setText(Langues.getString("RechercheInfo.contenu.text")); //$NON-NLS-1$ GroupLayout gl_contentPanel = new GroupLayout(contentPanel); gl_contentPanel.setHorizontalGroup( gl_contentPanel.createParallelGroup(Alignment.LEADING) .addGroup(gl_contentPanel.createSequentialGroup() .addGap(8) .addComponent(editorPane, GroupLayout.DEFAULT_SIZE, 569, Short.MAX_VALUE) .addContainerGap()) ); gl_contentPanel.setVerticalGroup( gl_contentPanel.createParallelGroup(Alignment.LEADING) .addGroup(Alignment.TRAILING, gl_contentPanel.createSequentialGroup() .addGap(20) .addComponent(editorPane, GroupLayout.DEFAULT_SIZE, 423, Short.MAX_VALUE) .addGap(9)) ); contentPanel.setLayout(gl_contentPanel); }
private void createGroups() { GroupLayout groupLayout = new GroupLayout(getContentPane()); groupLayout.setHorizontalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addContainerGap() .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING) .addComponent(lblProjectName) .addComponent(lblProjectLocation)) .addPreferredGap(ComponentPlacement.UNRELATED) .addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false) .addGroup(groupLayout.createSequentialGroup() .addComponent(btnSave) .addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnCancel)) .addComponent(text_projectLocation) .addComponent(text_projectName, GroupLayout.DEFAULT_SIZE, 180, Short.MAX_VALUE)) .addContainerGap(56, Short.MAX_VALUE)) ); groupLayout.setVerticalGroup( groupLayout.createParallelGroup(Alignment.LEADING) .addGroup(groupLayout.createSequentialGroup() .addGap(32) .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(lblProjectName) .addComponent(text_projectName, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(18) .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(lblProjectLocation) .addComponent(text_projectLocation, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addPreferredGap(ComponentPlacement.RELATED, 31, Short.MAX_VALUE) .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE) .addComponent(btnSave) .addComponent(btnCancel)) .addGap(26)) ); getContentPane().setLayout(groupLayout); }
private void initComponent() { this.initInputComponents(); final GroupLayout groupLayout = new GroupLayout(this); groupLayout.setAutoCreateContainerGaps(true); groupLayout.setAutoCreateGaps(true); this.setLayout(groupLayout); SequentialGroup horizontalGroup = groupLayout.createSequentialGroup(); ParallelGroup first = groupLayout.createParallelGroup(getLabelsAlignment()); ParallelGroup second = groupLayout.createParallelGroup(); ParallelGroup third = groupLayout.createParallelGroup(); parameters.forEach(c -> { first.addComponent(descriptionLabels.get(c)); second.addComponent(inputComponents.get(c)); third.addComponent(helpLabels.get(c)); }); horizontalGroup .addGroup(first) .addGroup(second) .addGroup(third); groupLayout.setHorizontalGroup(horizontalGroup); SequentialGroup verticalGroup = groupLayout.createSequentialGroup(); parameters.forEach(c -> { ParallelGroup current = groupLayout.createParallelGroup(Alignment.CENTER); current.addComponent(descriptionLabels.get(c)); current.addComponent(inputComponents.get(c)); current.addComponent(helpLabels.get(c)); verticalGroup.addGroup(current); }); groupLayout.setVerticalGroup(verticalGroup); }