Refine search
private void initializeComponents () { setLayout(new GridBagLayout()); JButton backwardButton, forwardButton; add(backwardButton = new JButton("<"), new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); add(regionsPanel = new JPanel(), new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); add(forwardButton = new JButton(">"), new GridBagConstraints(2, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); regionsPanel.setLayout(new CustomCardLayout()); backwardButton.addActionListener(new ActionListener() { @Override public void actionPerformed (ActionEvent arg0) {
private void initializeComponents () { JPanel contentPanel = getContentPanel(); { label = new JLabel("Value:"); contentPanel.add(label, new GridBagConstraints(2, 2, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0)); } { minSlider = new Slider(0, -99999, 99999, 1, -400, 400); contentPanel.add(minSlider, new GridBagConstraints(3, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } { maxSlider = new Slider(0, -99999, 99999, 1, -400, 400); contentPanel.add(maxSlider, new GridBagConstraints(4, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 6, 0, 0), 0, 0)); } { rangeButton = new JButton("<"); rangeButton.setBorder(BorderFactory.createEmptyBorder(6, 6, 6, 6)); contentPanel.add(rangeButton, new GridBagConstraints(5, 2, 1, 1, 1.0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 1, 0, 0), 0, 0)); } } }
effectsList.getListSelectionListeners()[0].valueChanged(null); setLayout(new GridBagLayout()); setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, java.awt.Color.black)); appliedEffectsPanel.add(this, constrains); JPanel titlePanel = new JPanel(); titlePanel.setLayout(new LayoutManager() { public void removeLayoutComponent (Component comp) { upButton = new JButton(); titlePanel.add(upButton); upButton.setText("Up"); upButton.setMargin(new Insets(0, 0, 0, 0)); downButton.setMargin(new Insets(0, 0, 0, 0)); deleteButton.setMargin(new Insets(0, 0, 0, 0)); add(titlePanel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 0, 0, 5), 0, 0)); valuesPanel.setLayout(new GridBagLayout()); add(valuesPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 10, 5, 0), 0, 0));
private void initializeComponents () { getContentPane().setLayout(new GridBagLayout()); JPanel leftSidePanel = new JPanel(); leftSidePanel.setLayout(new GridBagLayout()); getContentPane().add(leftSidePanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); JPanel fontPanel = new JPanel(); leftSidePanel.add(fontPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0)); fontPanel.setLayout(new GridBagLayout()); fontPanel.add(fontSizeSpinner, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 10), 0, 0)); ((JSpinner.DefaultEditor)fontSizeSpinner.getEditor()).getTextField().setColumns(2); GridBagConstraints.BOTH, new Insets(0, 0, 5, 5), 0, 0)); GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); systemFontRadio.setMargin(new Insets(0, 0, 0, 0)); GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); fontFileRadio.setMargin(new Insets(0, 0, 0, 0)); GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 0), 0, 0)); 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.HORIZONTAL, new Insets(0, 0, 0, 5), 0, 0));
private void initializeComponents () { JPanel contentPanel = getContentPanel(); { JLabel label = new JLabel("Value:"); contentPanel.add(label, new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0)); } { valueSpinner = new JSpinner(new SpinnerNumberModel(new Float(0), new Float(-99999), new Float(99999), new Float(0.1f))); contentPanel.add(valueSpinner, new GridBagConstraints(1, 1, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); } } }
protected void initializeComponents () { setLayout(new GridBagLayout()); titlePanel = new JPanel(new GridBagLayout()); add(titlePanel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(3, 0, 3, 0), 0, 0)); titlePanel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); nameLabel = new JLabel(name); titlePanel.add(nameLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(3, 6, 3, 6), 0, 0)); nameLabel.setFont(nameLabel.getFont().deriveFont(Font.BOLD)); titlePanel.add(descriptionLabel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(3, 6, 3, 6), 0, 0)); GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0)); advancedButton.setVisible(false); GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0)); removeButton = new JButton("X"); titlePanel.add(removeButton, new GridBagConstraints(4, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0)); new Insets(0, 6, 6, 6), 0, 0)); new Insets(0, 6, 6, 6), 0, 0));
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-2018: Joerg Wuethrich and contributors", JLabel.CENTER); JLabel contributorsLabel = new JLabel("contributors (alphabetically ordered):", JLabel.CENTER); JLabel buildDate = new JLabel("<html><font color=\"gray\">build date:</font> " + BuildInfoReader.getBuildDate() + "</html>", JLabel.CENTER); GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.anchor = GridBagConstraints.NORTH; gridBagConstraints.fill = GridBagConstraints.VERTICAL; versionPanel.add(copyright, gridBagConstraints); Insets insetsGapOnTop = new Insets(10, 0, 0, 0); GridBagConstraints gridBagConstraintsGapOnTop = new GridBagConstraints(); gridBagConstraintsGapOnTop.gridy = 1; gridBagConstraintsGapOnTop.insets = insetsGapOnTop;
JPanel panel = new JPanel(); panel.add(new JLabel("Global"), new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); panel.add(isGlobalCheckBox = new JCheckBox(), new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); contentPanel.add(panel,new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); contentPanel.add( magnitudePanel = new ScaledNumericPanel(editor, null, charTitle, "Strength", "In world units per second.", true), new GridBagConstraints(0, 2, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0)); spacer.setPreferredSize(new Dimension()); contentPanel.add(spacer, new GridBagConstraints(6, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
private void uiLayout () { topPanel = new JPanel(new GridBagLayout()); topPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); warningNotice = new JLabel("List of third party extensions for LibGDX"); warningNotice2 = new JLabel("These are not maintained by the LibGDX team, please see the support links for info and help"); warningNotice.setHorizontalAlignment(JLabel.CENTER); warningNotice2.setHorizontalAlignment(JLabel.CENTER); topPanel.add(warningNotice, new GridBagConstraints(0, 0, 1, 1, 1, 0, NORTH, HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); topPanel.add(warningNotice2, new GridBagConstraints(0, 1, 1, 1, 1, 0, NORTH, HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); separator.setBackground(new Color(85, 85, 85)); topPanel.add(separator, new GridBagConstraints(0, 2, 1, 1, 1, 1, NORTH, HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); bottomPanel = new JPanel(new GridBagLayout()); buttonPanel = new JPanel(new GridBagLayout()); buttonOK = new SetupButton("Save"); buttonCancel = new SetupButton("Cancel"); buttonPanel.add(buttonOK, new GridBagConstraints(0, 0, 1, 1, 0, 0, CENTER, HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); buttonPanel.add(buttonCancel, new GridBagConstraints(1, 0, 1, 1, 0, 0, CENTER, HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); bottomPanel.add(buttonPanel, new GridBagConstraints(3, 0, 1, 1, 1, 1, SOUTHEAST, NONE, new Insets(0, 0, 0, 0), 0, 0)); contentPane.add(topPanel, new GridBagConstraints(0, 0, 1, 1, 1, 0.1, NORTH, BOTH, new Insets(0, 0, 0, 0), 0, 0)); contentPane.add(scrollPane, new GridBagConstraints(0, 1, 1, 1, 1, 1, NORTH, BOTH, new Insets(0, 0, 0, 0), 0, 0)); contentPane.add(bottomPanel, new GridBagConstraints(0, 2, 1, 1, 1, 0, SOUTH, HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
titlePanel = new JPanel(new GridBagLayout()); add(titlePanel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(3, 0, 3, 0), 0, 0)); titlePanel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); JLabel label = new JLabel(name); titlePanel.add(label, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(3, 6, 3, 6), 0, 0)); label.setFont(label.getFont().deriveFont(Font.BOLD)); descriptionLabel = new JLabel(description); titlePanel.add(descriptionLabel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(3, 6, 3, 6), 0, 0)); titlePanel.add(advancedButton, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0)); advancedButton.setVisible(false); titlePanel.add(activeButton, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 6), 0, 0)); contentPanel = new JPanel(new GridBagLayout()); add(contentPanel, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 6, 6, 6), 0, 0)); contentPanel.setVisible(false); advancedPanel = new JPanel(new GridBagLayout()); add(advancedPanel, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 6, 6, 6), 0, 0));
new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, 21, 0, new Insets(0, 0, 0, 0), 0, 0)); JFormattedTextField field = new JFormattedTextField(connection.getXMPPServiceDomain()); field.setMinimumSize(new java.awt.Dimension(150, 20)); new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, 10, 2, new Insets(0, 0, 0, 0), 0, 0)); new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, 21, 0, new Insets(0, 0, 0, 0), 0, 0)); field = new JFormattedTextField(connection.getPort()); field.setMinimumSize(new java.awt.Dimension(150, 20)); new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, 10, 2, new Insets(0, 0, 0, 0), 0, 0)); new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, 21, 0, new Insets(0, 0, 0, 0), 0, 0)); userField = new JFormattedTextField(); userField.setMinimumSize(new java.awt.Dimension(150, 20)); new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, 10, 2, new Insets(0, 0, 0, 0), 0, 0)); new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, 21, 0, new Insets(0, 0, 0, 0), 0, 0)); field = new JFormattedTextField(new SimpleDateFormat("yyyy.MM.dd HH:mm:ss:SS")); field.setMinimumSize(new java.awt.Dimension(150, 20)); new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, 10, 2, new Insets(0, 0, 0, 0), 0, 0)); new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, 21, 0, new Insets(0, 0, 0, 0), 0, 0)); statusField = new JFormattedTextField(); statusField.setMinimumSize(new java.awt.Dimension(150, 20)); new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, 10, 2, new Insets(0, 0, 0, 0), 0, 0));
void addEditorRow (JPanel row) { row.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, java.awt.Color.black)); editRowsPanel.add(row, new GridBagConstraints(0, -1, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); }
public void addValue (final Value value) { JLabel valueNameLabel = new JLabel(value.getName() + ":"); valuesPanel.add(valueNameLabel, new GridBagConstraints(0, -1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0)); final JLabel valueValueLabel = new JLabel(); valuesPanel.add(valueValueLabel, new GridBagConstraints(1, -1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0)); valueValueLabel.setOpaque(true); if (value.getObject() instanceof java.awt.Color) valueValueLabel.setIcon(getColorIcon((java.awt.Color)value.getObject())); else valueValueLabel.setText(value.toString()); valueValueLabel.addMouseListener(new MouseAdapter() { public void mouseEntered (MouseEvent evt) { valueValueLabel.setBackground(selectedColor); } public void mouseExited (MouseEvent evt) { valueValueLabel.setBackground(null); } public void mouseClicked (MouseEvent evt) { Object oldObject = value.getObject(); value.showDialog(); if (!value.getObject().equals(oldObject)) { effect.setValues(values); updateValues(); updateFont(); } } }); }
GridBagLayout gridBag = new GridBagLayout(); GridBagConstraints constraints; Insets insets; JLabel filenameLabel = new JLabel("Filename:"); filenameLabel.setLabelFor(filename); insets = new Insets(12, 12, 0, 0); // top, left, bottom, right constraints = new GridBagConstraints( 0, 0, 1, 1, // x, y, width, height 0.0, 0.0, // weightx, weighty gridBag.setConstraints(filenameLabel, constraints); contentPane.add(filenameLabel); insets = new Insets(12, 7, 0, 12); // top, left, bottom, right constraints = new GridBagConstraints( 1, 0, 1, 1, // x, y, width, height 1.0, 1.0, // weightx, weighty gridBag.setConstraints(filename, constraints); contentPane.add(filename); insets = new Insets(0, 12, 12, 12); // top, left, bottom, right constraints = new GridBagConstraints( 0, 2, 2, 1, // x, y, width, height 1.0, 1.0, // weightx, weighty
public static void addContent( JPanel panel, int row, int column, JComponent component, boolean addBorders, int anchor, int fill, float wx, float wy){ if(addBorders) component.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, java.awt.Color.black)); panel.add(component, new GridBagConstraints(column, row, 1, 1, wx, wy, anchor, fill, new Insets(0, 0, 0, 0), 0, 0)); }
private void uiLayout () { title.setLayout(new GridLayout(1, 2)); minimize.setPreferredSize(new Dimension(50, 26)); exit.setPreferredSize(new Dimension(50, 26)); title.add(minimize); title.add(exit); topBar.setLayout(new GridLayout(1, 1)); topBar.add(windowLabel, new GridBagConstraints(0, 0, 0, 0, 0, 0, NORTHWEST, VERTICAL, new Insets(0, 0, 0, 0), 0, 0)); setLayout(new GridBagLayout()); add(topBar, new GridBagConstraints(0, 0, 0, 0, 0, 0, NORTH, HORIZONTAL, new Insets(0, 0, 0, 100), 0, 10)); add(title, new GridBagConstraints(0, 0, 0, 0, 0, 0, NORTHEAST, NONE, new Insets(0, 0, 0, 0), 0, 0)); add(logo, new GridBagConstraints(0, 0, 1, 1, 1, 0, CENTER, HORIZONTAL, new Insets(40, 6, 6, 6), 0, 0)); add(form, new GridBagConstraints(0, 1, 1, 1, 1, 0, CENTER, HORIZONTAL, new Insets(6, 6, 0, 6), 0, 0)); add(buttonPanel, new GridBagConstraints(0, 2, 1, 1, 0, 0, CENTER, NONE, new Insets(0, 0, 0, 0), 0, 0)); add(scrollPane, new GridBagConstraints(0, 3, 1, 1, 1, 1, CENTER, BOTH, new Insets(6, 6, 6, 6), 0, 0)); }
public void newGroup(String name, boolean withBorder) { currentPanel = new JPanel(); if (withBorder) { currentPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder(name), BorderFactory.createEmptyBorder(0,0,0,0))); } // using GridBagLayout because it allows for 2 columns with different widths currentLayout = new GridBagLayout(); currentConstraints = new GridBagConstraints(); currentConstraints.anchor = GridBagConstraints.WEST; currentConstraints.fill = GridBagConstraints.HORIZONTAL; currentConstraints.weightx = 1.0; currentConstraints.weighty = 1.0; currentConstraints.insets = new Insets(0, 3, 0, 3); currentConstraints.gridy = -1; currentPanel.setLayout(currentLayout); add(currentPanel); }
public SettingsGroup(String title) { setBorder(BorderFactory.createTitledBorder(title)); setLayout(new GridBagLayout()); c = new GridBagConstraints(); c.insets = new Insets(5, 5, 5, 5); c.weighty = 1.0; }
getScreenInsets(dialog.getGraphicsConfiguration()); int taskBarSize = scnMax.bottom; panel.setLayout(new GridBagLayout()); GridBagConstraints constraints = new GridBagConstraints(); constraints.gridx = 0; constraints.gridy = 0; constraints.weightx = 1.0f; constraints.weighty = 1.0f; constraints.insets = new Insets(5, 5, 5, 5); constraints.fill = GridBagConstraints.BOTH; JLabel l = new JLabel("You have got 2 new Messages."); panel.add(l, constraints); constraints.gridx++; constraints.fill = GridBagConstraints.NONE; constraints.anchor = GridBagConstraints.NORTH; JButton b = new JButton(new AbstractAction("x") { b.setMargin(new Insets(1, 4, 1, 4)); b.setFocusable(false); panel.add(b, constraints);
private void buildImagePanel (JLabel previewImage, File file) { previewContainer.removeAll(); previewContainer.add(previewImage, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); previewContainer.updateUI(); PreviewImagePanel.this.editor.renderer.setImageBackground(file); } });