List of usage examples for javax.swing BoxLayout Y_AXIS
int Y_AXIS
To view the source code for javax.swing BoxLayout Y_AXIS.
Click Source Link
From source file:org.championship.manager.license.LicenseDialog.java
public LicenseDialog(Frame owner) throws HeadlessException { super(owner, "License", true); setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS)); JScrollPane scrollPane = new JScrollPane(new LicenseEditorPane()); scrollPane.setAlignmentX(Component.CENTER_ALIGNMENT); add(scrollPane);/*from ww w. ja va 2 s. c om*/ JButton close = new JButton("Schlieen"); close.addActionListener(new ActionListener() { /** * {@inheritDoc} */ public void actionPerformed(ActionEvent e) { LicenseDialog.this.dispose(); } }); add(Box.createRigidArea(new Dimension(0, 5))); close.setAlignmentX(Component.CENTER_ALIGNMENT); add(close); prepareSize(); ComponentUtilities.centerComponentOnScreen(this); setVisible(true); }
From source file:org.codinjutsu.tools.nosql.NoSqlConfigurable.java
@Nullable @Override// w w w . j ava 2 s .co m public JComponent createComponent() { JPanel databaseVendorShellOptionsPanel = new JPanel(); databaseVendorShellOptionsPanel.setLayout(new BoxLayout(databaseVendorShellOptionsPanel, BoxLayout.Y_AXIS)); mongoShellPanel = new ShellPathPanel(DatabaseVendor.MONGO, "--version"); databaseVendorShellOptionsPanel.add(mongoShellPanel); redisShellPanel = new ShellPathPanel(DatabaseVendor.REDIS, "--version"); databaseVendorShellOptionsPanel.add(redisShellPanel); mainPanel.add(databaseVendorShellOptionsPanel, BorderLayout.NORTH); PanelWithButtons panelWithButtons = new PanelWithButtons() { { initPanel(); } @Nullable @Override protected String getLabelText() { return "Servers"; } @Override protected JButton[] createButtons() { return new JButton[] {}; } @Override protected JComponent createMainComponent() { table = new JBTable(tableModel); table.getEmptyText().setText("No server configuration set"); table.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); table.setDefaultRenderer(DatabaseVendor.class, new ColoredTableCellRenderer() { @Override protected void customizeCellRenderer(JTable jTable, Object value, boolean b, boolean b1, int i, int i1) { DatabaseVendor databaseVendor = (DatabaseVendor) value; this.setIcon(databaseVendor.icon); this.append(databaseVendor.name); } }); TableColumn autoConnectColumn = table.getColumnModel().getColumn(3); int autoConnectColumnWidth = table.getFontMetrics(table.getFont()) .stringWidth(table.getColumnName(3)) + 10; autoConnectColumn.setPreferredWidth(autoConnectColumnWidth); autoConnectColumn.setMaxWidth(autoConnectColumnWidth); autoConnectColumn.setMinWidth(autoConnectColumnWidth); return ToolbarDecorator.createDecorator(table).setAddAction(new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { stopEditing(); SelectDatabaseVendorDialog databaseVendorDialog = new SelectDatabaseVendorDialog(mainPanel); databaseVendorDialog.setTitle("Add a NoSql Server"); databaseVendorDialog.show(); if (!databaseVendorDialog.isOK()) { return; } DatabaseVendor selectedDatabaseVendor = databaseVendorDialog.getSelectedDatabaseVendor(); ServerConfiguration serverConfiguration = databaseVendorClientManager .get(selectedDatabaseVendor).defaultConfiguration(); serverConfiguration.setDatabaseVendor(selectedDatabaseVendor); ConfigurationDialog dialog = new ConfigurationDialog(mainPanel, serverConfigurationPanelFactory, serverConfiguration); dialog.setTitle("Add a NoSql Server"); dialog.show(); if (!dialog.isOK()) { return; } configurations.add(serverConfiguration); int index = configurations.size() - 1; tableModel.fireTableRowsInserted(index, index); table.getSelectionModel().setSelectionInterval(index, index); table.scrollRectToVisible(table.getCellRect(index, 0, true)); } }).setAddActionName("addServer").setEditAction(new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { stopEditing(); int selectedIndex = table.getSelectedRow(); if (selectedIndex < 0 || selectedIndex >= tableModel.getRowCount()) { return; } ServerConfiguration sourceConfiguration = configurations.get(selectedIndex); ServerConfiguration copiedConfiguration = sourceConfiguration.clone(); ConfigurationDialog dialog = new ConfigurationDialog(mainPanel, serverConfigurationPanelFactory, copiedConfiguration); dialog.setTitle("Edit a NoSql Server"); dialog.show(); if (!dialog.isOK()) { return; } configurations.set(selectedIndex, copiedConfiguration); tableModel.fireTableRowsUpdated(selectedIndex, selectedIndex); table.getSelectionModel().setSelectionInterval(selectedIndex, selectedIndex); } }).setEditActionName("editServer").setRemoveAction(new AnActionButtonRunnable() { @Override public void run(AnActionButton button) { stopEditing(); int selectedIndex = table.getSelectedRow(); if (selectedIndex < 0 || selectedIndex >= tableModel.getRowCount()) { return; } TableUtil.removeSelectedItems(table); } }).setRemoveActionName("removeServer").disableUpDownActions().createPanel(); } }; mainPanel.add(panelWithButtons, BorderLayout.CENTER); return mainPanel; }
From source file:org.colombbus.tangara.AboutWindow.java
/** * Sets the image zone of the about window, * * @param backgroundImg//ww w .ja va 2 s .c o m */ private void initialize(Image backgroundImg) { updateWindowIcon(); BufferedImage headerImage = createBackgroundImage(backgroundImg); imagePanel = new ImageComponent(headerImage); imagePanel.setBounds(0, 0, headerImage.getWidth(), headerImage.getHeight()); imagePanel.setOpaque(true); imagePanel.setLayout(new BoxLayout(imagePanel, BoxLayout.Y_AXIS)); imagePanel.add(Box.createVerticalStrut(windowHeight / 2)); JPanel panel = bodyPanel(); imagePanel.add(panel); imagePanel.add(Box.createVerticalStrut(marginBottom)); setContentPane(imagePanel); }
From source file:org.colombbus.tangara.update.SoftwareUpdateDialog.java
private void addCenterPane() { JPanel centerPane = new JPanel(); BoxLayout layout = new BoxLayout(centerPane, BoxLayout.Y_AXIS); centerPane.setLayout(layout);/*from w ww . j a v a2 s . c o m*/ JTextArea descPane = new JTextArea(info.getDescription()); descPane.setFont(font); descPane.setEditable(false); centerPane.add(descPane); JPanel linkPanel = new JPanel(); linkPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); String linkTitle = bundle.getString("SoftwareUpdateDialog.linkTitle"); //$NON-NLS-1$ JLabel linkTitleLabel = new JLabel(linkTitle); linkTitleLabel.setFont(font); linkPanel.add(linkTitleLabel); HyperLinkLabel linkLabel = new HyperLinkLabel(info.getLink(), info.getLink()); linkLabel.setFont(font); linkPanel.add(linkLabel); linkPanel.setBackground(Color.white); linkPanel.setOpaque(true); centerPane.add(linkPanel); add(centerPane, BorderLayout.CENTER); }
From source file:org.dishevelled.brainstorm.BrainStorm.java
/** * Layout components./*from w w w . j av a 2 s . co m*/ */ private void layoutComponents() { setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JScrollPane scrollPane = new JScrollPane(textArea); scrollPane.setBorder(null); scrollPane.setOpaque(true); scrollPane.setBackground(backgroundColor); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); add(placeholder); JPanel flow = new JPanel(); flow.setLayout(new FlowLayout()); flow.setOpaque(false); flow.add(scrollPane); add(flow); add(Box.createVerticalGlue()); add(Box.createVerticalGlue()); }
From source file:org.drools.planner.examples.nurserostering.swingui.NurseRosteringPanel.java
private void createEmployeeListPanel() { employeeListPanel = new JPanel(); employeeListPanel.setLayout(new BoxLayout(employeeListPanel, BoxLayout.Y_AXIS)); unassignedPanel = new EmployeePanel(this, Collections.<ShiftDate>emptyList(), Collections.<Shift>emptyList(), null); employeeListPanel.add(unassignedPanel); employeeToPanelMap = new LinkedHashMap<Employee, EmployeePanel>(); employeeToPanelMap.put(null, unassignedPanel); shiftAssignmentToPanelMap = new LinkedHashMap<ShiftAssignment, EmployeePanel>(); }
From source file:org.dwfa.ace.classifier.CNFormsLabelPanel.java
public void setConcept(I_GetConceptData conceptIn, I_ConfigAceFrame config) throws IOException, TerminologyException { this.theCBean = conceptIn; this.config = config; commonJPanel.removeAll();/*from ww w . j ava 2s .c o m*/ deltaJPanel.removeAll(); formsJPanel.removeAll(); // FORMS HAS SUBPANELS: STATED & COMPUTED if (conceptIn == null) return; // COMMON & DIFFERENT SECTION // COMMON PANEL commonLabels = getCommonLabels(showDetailCB.isSelected(), showStatusCB.isSelected(), config); // #### commonPartJPanel = new JPanel(); setMinMaxSize(commonPartJPanel); commonPartJPanel.setLayout(new BoxLayout(commonPartJPanel, BoxLayout.Y_AXIS)); for (I_ImplementActiveLabel l : commonLabels) { commonPartJPanel.add(l.getLabel()); } GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.NONE; c.anchor = GridBagConstraints.NORTHWEST; c.gridheight = 1; c.gridwidth = 1; c.weightx = 0; c.weighty = 0; c.gridx = 0; c.gridy = 0; commonJPanel.add(commonPartJPanel, c); // DELTA (DIFFERENCES) PANEL Map<I_ConceptAttributeTuple, Color> conAttrColorMap = new HashMap<I_ConceptAttributeTuple, Color>(); Map<I_DescriptionTuple, Color> desColorMap = new HashMap<I_DescriptionTuple, Color>(); Map<I_RelTuple, Color> relColorMap = new HashMap<I_RelTuple, Color>(); colors.reset(); Collection<I_ImplementActiveLabel> deltaLabels = getDeltaLabels(showDetailCB.isSelected(), showStatusCB.isSelected(), config, colors, conAttrColorMap, desColorMap, relColorMap); // #### deltaPartJPanel = new JPanel(); deltaPartJPanel.setLayout(new BoxLayout(deltaPartJPanel, BoxLayout.Y_AXIS)); for (I_ImplementActiveLabel l : deltaLabels) { deltaPartJPanel.add(l.getLabel()); } deltaJPanel.add(deltaPartJPanel); // FORM STATED PANEL c = new GridBagConstraints(); c.fill = GridBagConstraints.VERTICAL; c.anchor = GridBagConstraints.NORTHWEST; c.weightx = 0; // horizontal free space distribution weight c.weighty = 0; // vertical free space distribution weight c.gridx = 0; c.gridy = 0; JPanel tmpJPanel; tmpJPanel = newFormStatedJPanel("Stated Form:", config, conAttrColorMap, desColorMap, relColorMap); // #### setMinMaxSize(tmpJPanel); formsJPanel.add(tmpJPanel, c); // FORM DISTRIBUTION NORMAL PANEL if (showDistFormCB.isSelected()) { c.gridx++; if (c.gridx == 2) { c.gridx = 0; c.gridy++; } tmpJPanel = newFormDistJPanel("Distribution Normal Form:", config, conAttrColorMap, desColorMap, relColorMap); // #### setMinMaxSize(tmpJPanel); formsJPanel.add(tmpJPanel, c); } // AUTHORING NORMAL FORM PANEL if (showAuthFormCB.isSelected()) { c.gridx++; if (c.gridx == 2) { c.gridx = 0; c.gridy++; } tmpJPanel = newFormAuthJPanel("Authoring Normal Form:", config, conAttrColorMap, desColorMap, relColorMap); // #### setMinMaxSize(tmpJPanel); formsJPanel.add(tmpJPanel, c); } // LONG CANONICAL FORM PANEL if (showLongFormCB.isSelected()) { c.gridx++; if (c.gridx == 2) { c.gridx = 0; c.gridy++; } tmpJPanel = newFormLongJPanel("Long Canonical Form:", config, conAttrColorMap, desColorMap, relColorMap); // #### setMinMaxSize(tmpJPanel); formsJPanel.add(tmpJPanel, c); } // FORM SHORT CANONICAL PANEL if (showShortFormCB.isSelected()) { c.gridx++; if (c.gridx == 2) { c.gridx = 0; c.gridy++; } tmpJPanel = newFormShortJPanel("Short Canonical Form:", config, conAttrColorMap, desColorMap, relColorMap); // #### setMinMaxSize(tmpJPanel); formsJPanel.add(tmpJPanel, c); } }
From source file:org.ecoinformatics.seek.ecogrid.EcogridPreferencesTab.java
/** * Description of the Method/*from w ww .java2s .c o m*/ */ private void initTextPanel() { // text part of text panel JPanel textTopPanel = new JPanel(); textTopPanel.setLayout(new BoxLayout(textTopPanel, BoxLayout.X_AXIS)); textTopPanel.add(textLabel); textTopPanel.add(Box.createHorizontalGlue()); // y box layout textPanel.setLayout(new BoxLayout(textPanel, BoxLayout.Y_AXIS)); textPanel.add(textTopPanel); textPanel.add(Box.createVerticalStrut(GAP)); }
From source file:org.esa.snap.smart.configurator.ui.PerformancePanel.java
/** * This method is called from within the constructor to initialize the form. *//* w w w. ja v a 2 s .c o m*/ private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; systemParametersPanel = new javax.swing.JPanel(); cachePathLabel = new javax.swing.JLabel(); vmParametersTextField = new javax.swing.JTextField(); editVMParametersButton = new javax.swing.JButton(); cachePathTextField = new javax.swing.JTextField(); browseUserDirButton = new javax.swing.JButton(); vmParametersLabel = new javax.swing.JLabel(); sysResetButton = new javax.swing.JButton(); sysComputeButton = new javax.swing.JButton(); largeCacheInfoLabel = new javax.swing.JLabel(); vmParametersInfoLabel = new javax.swing.JLabel(); processingParametersPanel = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); tileWidthLabel = new javax.swing.JLabel(); cacheSizeLabel = new javax.swing.JLabel(); nbThreadsLabel = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); defaultTileSizeTextField = new javax.swing.JTextField(); cacheSizeTextField = new javax.swing.JTextField(); nbThreadsTextField = new javax.swing.JTextField(); jPanel4 = new javax.swing.JPanel(); benchmarkTileSizeTextField = new javax.swing.JTextField(); benchmarkCacheSizeTextField = new javax.swing.JTextField(); benchmarkNbThreadsTextField = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); procGraphJComboBox = new javax.swing.JComboBox(getBenchmarkOperators()); jPanel3 = new javax.swing.JPanel(); processingParamsComputeButton = new javax.swing.JButton(); processingParamsResetButton = new javax.swing.JButton(); BoxLayout perfPanelLayout = new BoxLayout(this, BoxLayout.Y_AXIS); setLayout(perfPanelLayout); Box.createVerticalGlue(); systemParametersPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle .getMessage(PerformancePanel.class, "PerformancePanel.systemParametersPanel.border.title"))); systemParametersPanel.setMinimumSize(new java.awt.Dimension(283, 115)); systemParametersPanel.setLayout(new java.awt.GridBagLayout()); org.openide.awt.Mnemonics.setLocalizedText(cachePathLabel, org.openide.util.NbBundle.getMessage(PerformancePanel.class, "PerformancePanel.jLabel2.text")); cachePathLabel.setMaximumSize(new java.awt.Dimension(100, 14)); cachePathLabel.setPreferredSize(new java.awt.Dimension(80, 14)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 10, 0, 0); systemParametersPanel.add(cachePathLabel, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(vmParametersLabel, org.openide.util.NbBundle.getMessage(PerformancePanel.class, "PerformancePanel.jLabel3.text")); vmParametersLabel.setMaximumSize(new java.awt.Dimension(200, 14)); vmParametersLabel.setMinimumSize(new java.awt.Dimension(100, 14)); vmParametersLabel.setPreferredSize(new java.awt.Dimension(80, 14)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 10, 0, 0); systemParametersPanel.add(vmParametersLabel, gridBagConstraints); vmParametersTextField.setText(org.openide.util.NbBundle.getMessage(PerformancePanel.class, "PerformancePanel.vmParametersTextField.text")); vmParametersTextField.setToolTipText(org.openide.util.NbBundle.getMessage(PerformancePanel.class, "PerformancePanel.vmParametersTextField.toolTipText")); if (!VMParameters.canSave()) { vmParametersTextField.setEditable(false); } vmParametersTextField.setColumns(50); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = java.awt.GridBagConstraints.RELATIVE; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 2.0; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); systemParametersPanel.add(vmParametersTextField, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(editVMParametersButton, org.openide.util.NbBundle .getMessage(PerformancePanel.class, "PerformancePanel.editVMParametersButton.text")); editVMParametersButton.addActionListener(this::editVMParametersButtonActionPerformed); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 2, 0, 10); systemParametersPanel.add(editVMParametersButton, gridBagConstraints); if (!VMParameters.canSave()) { vmParametersLabel.setEnabled(false); vmParametersTextField.setEnabled(false); editVMParametersButton.setEnabled(false); String vmParameterDisableToolTip = "VM parameters can't be saved from SNAP, please use the snap-conf-optimiser application as an administrator to change them"; vmParametersLabel.setToolTipText(vmParameterDisableToolTip); vmParametersTextField.setToolTipText(vmParameterDisableToolTip); editVMParametersButton.setToolTipText(vmParameterDisableToolTip); } cachePathTextField.setText(org.openide.util.NbBundle.getMessage(PerformancePanel.class, "PerformancePanel.userDirTextField.text")); cachePathTextField.setToolTipText(org.openide.util.NbBundle.getMessage(PerformancePanel.class, "PerformancePanel.userDirTextField.toolTipText")); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.gridwidth = java.awt.GridBagConstraints.RELATIVE; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 2.0; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0); systemParametersPanel.add(cachePathTextField, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(browseUserDirButton, org.openide.util.NbBundle .getMessage(PerformancePanel.class, "PerformancePanel.browseUserDirButton.text")); browseUserDirButton.addActionListener(evt -> browseCachePathButtonActionPerformed()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 2, 0, 10); systemParametersPanel.add(browseUserDirButton, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(sysResetButton, org.openide.util.NbBundle .getMessage(PerformancePanel.class, "PerformancePanel.sysResetButton.text")); sysResetButton.addActionListener(evt -> sysResetButtonActionPerformed()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 4; gridBagConstraints.insets = new java.awt.Insets(10, 3, 0, 10); systemParametersPanel.add(sysResetButton, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(sysComputeButton, org.openide.util.NbBundle .getMessage(PerformancePanel.class, "PerformancePanel.sysComputeButton.text")); sysComputeButton.addActionListener(evt -> sysComputeButtonActionPerformed()); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 4; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(10, 0, 0, 3); systemParametersPanel.add(sysComputeButton, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(largeCacheInfoLabel, org.openide.util.NbBundle .getMessage(PerformancePanel.class, "PerformancePanel.largeCacheInfoLabel.text")); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; systemParametersPanel.add(largeCacheInfoLabel, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(vmParametersInfoLabel, org.openide.util.NbBundle .getMessage(PerformancePanel.class, "PerformancePanel.vmParametersInfoLabel.text")); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; systemParametersPanel.add(vmParametersInfoLabel, gridBagConstraints); add(systemParametersPanel); Box.createVerticalGlue(); processingParametersPanel.setBorder(javax.swing.BorderFactory.createTitledBorder( org.openide.util.NbBundle.getMessage(PerformancePanel.class, "PerformancePanel.border.title"))); processingParametersPanel.setName(""); processingParametersPanel.setLayout(new java.awt.GridBagLayout()); jPanel2.setLayout(new java.awt.GridLayout(3, 0, 0, 15)); org.openide.awt.Mnemonics.setLocalizedText(tileWidthLabel, org.openide.util.NbBundle .getMessage(PerformancePanel.class, "PerformancePanel.tileWidthLabel.text")); tileWidthLabel.setMaximumSize(new java.awt.Dimension(120, 14)); tileWidthLabel.setPreferredSize(new java.awt.Dimension(100, 14)); jPanel2.add(tileWidthLabel); org.openide.awt.Mnemonics.setLocalizedText(cacheSizeLabel, org.openide.util.NbBundle .getMessage(PerformancePanel.class, "PerformancePanel.cacheSizeLabel.text")); cacheSizeLabel.setMaximumSize(new java.awt.Dimension(100, 14)); cacheSizeLabel.setPreferredSize(new java.awt.Dimension(80, 14)); jPanel2.add(cacheSizeLabel); org.openide.awt.Mnemonics.setLocalizedText(nbThreadsLabel, org.openide.util.NbBundle .getMessage(PerformancePanel.class, "PerformancePanel.nbThreadsLabel.text")); nbThreadsLabel.setMaximumSize(new java.awt.Dimension(100, 14)); jPanel2.add(nbThreadsLabel); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.insets = new java.awt.Insets(10, 10, 0, 0); processingParametersPanel.add(jPanel2, gridBagConstraints); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle .getMessage(PerformancePanel.class, "PerformancePanel.jPanel1.border.title"))); jPanel1.setMinimumSize(new java.awt.Dimension(100, 100)); jPanel1.setLayout(new java.awt.GridLayout(3, 1, 0, 10)); defaultTileSizeTextField.setText(org.openide.util.NbBundle.getMessage(PerformancePanel.class, "PerformancePanel.defaultTileSizeTextField.text")); defaultTileSizeTextField.setMinimumSize(new java.awt.Dimension(100, 20)); defaultTileSizeTextField.setPreferredSize(new java.awt.Dimension(100, 20)); jPanel1.add(defaultTileSizeTextField); cacheSizeTextField.setText(org.openide.util.NbBundle.getMessage(PerformancePanel.class, "PerformancePanel.cacheSizeTextField.text")); cacheSizeTextField.setMinimumSize(new java.awt.Dimension(100, 20)); cacheSizeTextField.setName(""); cacheSizeTextField.setPreferredSize(new java.awt.Dimension(100, 20)); jPanel1.add(cacheSizeTextField); nbThreadsTextField.setText(org.openide.util.NbBundle.getMessage(PerformancePanel.class, "PerformancePanel.nbThreadsTextField.text")); nbThreadsTextField.setPreferredSize(new java.awt.Dimension(100, 20)); jPanel1.add(nbThreadsTextField); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; processingParametersPanel.add(jPanel1, gridBagConstraints); jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(org.openide.util.NbBundle .getMessage(PerformancePanel.class, "PerformancePanel.jPanel4.border.title"))); jPanel4.setMinimumSize(new java.awt.Dimension(190, 107)); jPanel4.setLayout(new java.awt.GridLayout(3, 1, 0, 10)); PerformanceParameters actualParameters = confOptimizer.getActualPerformanceParameters(); String tileSizeBenchmarkValues = getDefaultTileSizeValuesForBenchmark( actualParameters.getDefaultTileSize()); benchmarkTileSizeTextField.setText(tileSizeBenchmarkValues); benchmarkTileSizeTextField.setPreferredSize(new java.awt.Dimension(150, 20)); jPanel4.add(benchmarkTileSizeTextField); String cacheSizeBenchmarkValues = getDefaultCacheSizeValuesForBenchmark(actualParameters); benchmarkCacheSizeTextField.setText(cacheSizeBenchmarkValues); benchmarkCacheSizeTextField.setMinimumSize(new java.awt.Dimension(100, 20)); benchmarkCacheSizeTextField.setName(""); benchmarkCacheSizeTextField.setPreferredSize(new java.awt.Dimension(150, 20)); jPanel4.add(benchmarkCacheSizeTextField); benchmarkNbThreadsTextField .setText(Integer.toString(actualParameters.getNbThreads()) + BENCHMARK_SEPARATOR); benchmarkNbThreadsTextField.setPreferredSize(new java.awt.Dimension(150, 20)); jPanel4.add(benchmarkNbThreadsTextField); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 2.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 10); processingParametersPanel.add(jPanel4, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(PerformancePanel.class, "PerformancePanel.jLabel1.text")); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 10, 0, 0); processingParametersPanel.add(jLabel1, gridBagConstraints); procGraphJComboBox.setMinimumSize(new java.awt.Dimension(180, 22)); nbThreadsTextField.setMinimumSize(new java.awt.Dimension(100, 20)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 10); processingParametersPanel.add(procGraphJComboBox, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(processingParamsComputeButton, org.openide.util.NbBundle.getMessage(PerformancePanel.class, "PerformancePanel.text")); processingParamsComputeButton.setName(""); processingParamsComputeButton.addActionListener(this::processingParamsComputeButtonActionPerformed); jPanel3.add(processingParamsComputeButton); org.openide.awt.Mnemonics.setLocalizedText(processingParamsResetButton, org.openide.util.NbBundle .getMessage(PerformancePanel.class, "PerformancePanel.processingParamsResetButton.text")); processingParamsResetButton.addActionListener(this::processingParamsResetButtonActionPerformed); jPanel3.add(processingParamsResetButton); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 5); processingParametersPanel.add(jPanel3, gridBagConstraints); add(processingParametersPanel); }
From source file:org.jas.dnd.DragTooltipDialog.java
private JPanel getDescriptionPanel() { if (descriptionPanel == null) { descriptionPanel = new JPanel(); descriptionPanel.setLayout(new BoxLayout(descriptionPanel, BoxLayout.Y_AXIS)); }// w w w. ja v a2 s. c o m return descriptionPanel; }