List of usage examples for javax.swing.border TitledBorder CENTER
int CENTER
To view the source code for javax.swing.border TitledBorder CENTER.
Click Source Link
From source file:Main.java
public static void main(String[] argv) { LineBorder border = new LineBorder(Color.red); TitledBorder titledBorder = BorderFactory.createTitledBorder(border, "Title"); // Or: DEFAULT_JUSTIFICATION, LEFT, RIGHT titledBorder.setTitleJustification(TitledBorder.CENTER); }
From source file:MainClass.java
public static void main(final String args[]) { JFrame frame = new JFrame("Justified Titled Borders"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); TitledBorder centerBorder = BorderFactory.createTitledBorder("Center"); centerBorder.setTitleJustification(TitledBorder.CENTER); JButton centerButton = new JButton(); centerButton.setBorder(centerBorder); Container contentPane = frame.getContentPane(); contentPane.add(centerButton);/* w w w .ja v a 2s .com*/ frame.setSize(300, 200); frame.setVisible(true); }
From source file:Main.java
public static void main(String[] args) { JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Table Title", TitledBorder.CENTER, TitledBorder.TOP)); JTable table = new JTable(3, 3); panel.add(new JScrollPane(table)); frame.add(panel);/*from w ww .ja va2 s .c o m*/ frame.pack(); frame.setVisible(true); }
From source file:TitledJustBorder.java
public static void main(String args[]) { JFrame frame = new JFrame("Justified Titled Borders"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); TitledBorder leftBorder = BorderFactory.createTitledBorder("Left"); leftBorder.setTitleJustification(TitledBorder.LEFT); JButton leftButton = new JButton(); leftButton.setBorder(leftBorder);/*from w w w . j av a 2 s . c o m*/ TitledBorder rightBorder = BorderFactory.createTitledBorder("Right"); rightBorder.setTitleJustification(TitledBorder.RIGHT); JButton rightButton = new JButton(); rightButton.setBorder(rightBorder); TitledBorder centerBorder = BorderFactory.createTitledBorder("Center"); centerBorder.setTitleJustification(TitledBorder.CENTER); JButton centerButton = new JButton(); centerButton.setBorder(centerBorder); Container contentPane = frame.getContentPane(); contentPane.setLayout(new GridLayout(3, 1)); contentPane.add(leftButton); contentPane.add(rightButton); contentPane.add(centerButton); frame.setSize(300, 200); frame.setVisible(true); }
From source file:com.digitalgeneralists.assurance.ui.components.ExclusionsPanel.java
@Override protected void initializeComponent() { if (!this.initialized) { if (this.exclusion == null) { this.mode = AssuranceDialogMode.ADD; this.dialogTitle = "Add New Exclusion"; this.exclusion = new FileReference(); } else {/* ww w. j av a 2s . c o m*/ this.mode = AssuranceDialogMode.EDIT; this.dialogTitle = "Edit Exclusion"; } GridBagLayout gridbag = new GridBagLayout(); this.setLayout(gridbag); final JPanel exclusionPathPanel = new JPanel(); exclusionPathPanel.setLayout(new GridBagLayout()); Border exclusionPanelBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED); exclusionPanelBorder = BorderFactory.createTitledBorder(exclusionPanelBorder, "Exclusion", TitledBorder.CENTER, TitledBorder.TOP); GridBagConstraints exclusionPathPanelConstraints = new GridBagConstraints(); exclusionPathPanelConstraints.anchor = GridBagConstraints.NORTH; exclusionPathPanelConstraints.fill = GridBagConstraints.HORIZONTAL; exclusionPathPanelConstraints.gridx = 0; exclusionPathPanelConstraints.gridy = 0; exclusionPathPanelConstraints.weightx = 1.0; exclusionPathPanelConstraints.weighty = 1.0; exclusionPathPanelConstraints.gridheight = 1; exclusionPathPanelConstraints.gridwidth = 2; exclusionPathPanelConstraints.insets = new Insets(5, 5, 5, 5); exclusionPathPanel.setBorder(exclusionPanelBorder); this.add(exclusionPathPanel, exclusionPathPanelConstraints); GridBagConstraints exclusionPathFieldConstraints = new GridBagConstraints(); exclusionPathFieldConstraints.anchor = GridBagConstraints.NORTH; exclusionPathFieldConstraints.fill = GridBagConstraints.HORIZONTAL; exclusionPathFieldConstraints.gridx = 0; exclusionPathFieldConstraints.gridy = 1; exclusionPathFieldConstraints.weightx = 1.0; exclusionPathFieldConstraints.weighty = 1.0; exclusionPathFieldConstraints.gridheight = 1; exclusionPathFieldConstraints.gridwidth = 1; exclusionPathFieldConstraints.insets = new Insets(5, 5, 5, 5); exclusionPathPanel.add(this.exclusionPathTextFieldPicker, exclusionPathFieldConstraints); if (this.exclusion != null) { File exclusionPath = exclusion.getFile(); if (exclusionPath != null) { this.exclusionPathTextFieldPicker.setValue(exclusionPath.getPath()); } else { this.exclusionPathTextFieldPicker.setValue(""); } } this.initialized = true; } }
From source file:com.fisher.mainFrame.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - nick xu dialogPane = new JPanel(); contentPanel = new JPanel(); scrollPaneLogArea = new JScrollPane(); logArea = new JTextArea(); buttonBar = new JPanel(); startButton = new JButton(); stopButton = new JButton(); //======== this ======== setTitle("Fish Transform Trading"); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {/*from ww w.j a v a2 s. co m*/ dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12)); dialogPane.setPreferredSize(new Dimension(758, 900)); // JFormDesigner evaluation mark dialogPane.setBorder(new javax.swing.border.CompoundBorder( new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0), "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red), dialogPane.getBorder())); dialogPane.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent e) { if ("border".equals(e.getPropertyName())) throw new RuntimeException(); } }); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { //======== scrollPaneLogArea ======== { scrollPaneLogArea.setViewportView(logArea); } GroupLayout contentPanelLayout = new GroupLayout(contentPanel); contentPanel.setLayout(contentPanelLayout); contentPanelLayout.setHorizontalGroup(contentPanelLayout.createParallelGroup() .addComponent(scrollPaneLogArea, GroupLayout.DEFAULT_SIZE, 734, Short.MAX_VALUE)); contentPanelLayout .setVerticalGroup(contentPanelLayout.createParallelGroup() .addGroup(contentPanelLayout .createSequentialGroup().addComponent(scrollPaneLogArea, GroupLayout.PREFERRED_SIZE, 225, GroupLayout.PREFERRED_SIZE) .addGap(0, 476, Short.MAX_VALUE))); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); buttonBar.setLayout(new GridBagLayout()); ((GridBagLayout) buttonBar.getLayout()).columnWidths = new int[] { 0, 85, 80 }; ((GridBagLayout) buttonBar.getLayout()).columnWeights = new double[] { 1.0, 0.0, 0.0 }; //---- startButton ---- startButton.setText("Start"); startButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { startButtonActionPerformed(e); } }); buttonBar.add(startButton, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0)); //---- stopButton ---- stopButton.setText("Stop"); stopButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { stopButtonActionPerformed(e); } }); buttonBar.add(stopButton, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:com.digitalgeneralists.assurance.ui.components.ScanPathMappingPanel.java
protected void initializeComponent() { if (!this.initialized) { if (this.mappingDefinition == null) { this.mode = AssuranceDialogMode.ADD; this.dialogTitle = "Add New Path Mapping"; this.mappingDefinition = new ScanMappingDefinition(); } else {/* w ww.jav a2 s .c om*/ this.mode = AssuranceDialogMode.EDIT; this.dialogTitle = "Edit Path Mapping"; } GridBagLayout gridbag = new GridBagLayout(); this.setLayout(gridbag); final JPanel scanPathsPanel = new JPanel(); scanPathsPanel.setLayout(new GridBagLayout()); Border pathsPanelBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED); pathsPanelBorder = BorderFactory.createTitledBorder(pathsPanelBorder, "Paths", TitledBorder.CENTER, TitledBorder.TOP); GridBagConstraints scanPathsPanelConstraints = new GridBagConstraints(); scanPathsPanelConstraints.anchor = GridBagConstraints.NORTH; scanPathsPanelConstraints.fill = GridBagConstraints.HORIZONTAL; scanPathsPanelConstraints.gridx = 0; scanPathsPanelConstraints.gridy = 0; scanPathsPanelConstraints.weightx = 1.0; scanPathsPanelConstraints.weighty = 1.0; scanPathsPanelConstraints.gridheight = 1; scanPathsPanelConstraints.gridwidth = 2; scanPathsPanelConstraints.insets = new Insets(5, 5, 5, 5); scanPathsPanel.setBorder(pathsPanelBorder); this.add(scanPathsPanel, scanPathsPanelConstraints); GridBagConstraints sourcePathFieldConstraints = new GridBagConstraints(); sourcePathFieldConstraints.anchor = GridBagConstraints.NORTH; sourcePathFieldConstraints.fill = GridBagConstraints.HORIZONTAL; sourcePathFieldConstraints.gridx = 0; sourcePathFieldConstraints.gridy = 0; sourcePathFieldConstraints.weightx = 1.0; sourcePathFieldConstraints.weighty = 1.0; sourcePathFieldConstraints.gridheight = 1; sourcePathFieldConstraints.gridwidth = 1; sourcePathFieldConstraints.insets = new Insets(0, 5, 5, 5); GridBagConstraints targetPathFieldConstraints = new GridBagConstraints(); targetPathFieldConstraints.anchor = GridBagConstraints.NORTH; targetPathFieldConstraints.fill = GridBagConstraints.HORIZONTAL; targetPathFieldConstraints.gridx = 0; targetPathFieldConstraints.gridy = 1; targetPathFieldConstraints.weightx = 1.0; targetPathFieldConstraints.weighty = 1.0; targetPathFieldConstraints.gridheight = 1; targetPathFieldConstraints.gridwidth = 1; targetPathFieldConstraints.insets = new Insets(5, 5, 5, 5); scanPathsPanel.add(this.sourcePathPickerField, sourcePathFieldConstraints); scanPathsPanel.add(this.targetPathPickerField, targetPathFieldConstraints); if (mappingDefinition != null) { File source = mappingDefinition.getSource(); if (source != null) { this.sourcePathPickerField.setValue(source.getPath()); } else { this.sourcePathPickerField.setValue(""); } File target = mappingDefinition.getTarget(); if (target != null) { this.targetPathPickerField.setValue(target.getPath()); } else { this.targetPathPickerField.setValue(""); } } Border existingExclusionsPanelBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED); existingExclusionsPanelBorder = BorderFactory.createTitledBorder(existingExclusionsPanelBorder, "Exclusions", TitledBorder.CENTER, TitledBorder.TOP); GridBagConstraints existingExclusionsPanelConstraints = new GridBagConstraints(); existingExclusionsPanelConstraints.anchor = GridBagConstraints.WEST; existingExclusionsPanelConstraints.fill = GridBagConstraints.BOTH; existingExclusionsPanelConstraints.gridx = 0; existingExclusionsPanelConstraints.gridy = 1; existingExclusionsPanelConstraints.weightx = 1.0; existingExclusionsPanelConstraints.weighty = 0.9; existingExclusionsPanelConstraints.gridheight = 1; existingExclusionsPanelConstraints.gridwidth = 2; existingExclusionsPanelConstraints.insets = new Insets(0, 5, 0, 5); JPanel existingExclusionsPanel = new JPanel(); GridBagLayout panelGridbag = new GridBagLayout(); existingExclusionsPanel.setLayout(panelGridbag); existingExclusionsPanel.setBorder(existingExclusionsPanelBorder); this.add(existingExclusionsPanel, existingExclusionsPanelConstraints); GridBagConstraints existingExclusionsListConstraints = new GridBagConstraints(); existingExclusionsListConstraints.anchor = GridBagConstraints.WEST; existingExclusionsListConstraints.fill = GridBagConstraints.BOTH; existingExclusionsListConstraints.gridx = 0; existingExclusionsListConstraints.gridy = 0; existingExclusionsListConstraints.weightx = 1.0; existingExclusionsListConstraints.weighty = 0.9; existingExclusionsListConstraints.gridheight = 1; existingExclusionsListConstraints.gridwidth = 2; existingExclusionsListConstraints.insets = new Insets(5, 5, 5, 5); this.mappingDefinition = (ScanMappingDefinition) ModelUtils.initializeEntity(this.mappingDefinition, ScanMappingDefinition.EXCLUSIONS_PROPERTY); this.exclusionsPanel = new ListInputPanel<FileReference>(this.mappingDefinition, this); existingExclusionsPanel.add(this.exclusionsPanel, existingExclusionsListConstraints); this.initialized = true; } }
From source file:com.floreantpos.ui.views.order.modifier.TicketItemModifierTableView.java
private void initComponents() { titledBorder.setTitle(modifierSelectionModel.getTicketItem().getName()); titledBorder.setTitleJustification(TitledBorder.CENTER); setBorder(border);/*from w ww . jav a 2 s . c o m*/ setLayout(new java.awt.BorderLayout(5, 5)); ticketItemActionPanel = new com.floreantpos.swing.TransparentPanel(); //btnDecreaseAmount = new com.floreantpos.swing.PosButton(); btnScrollDown = new com.floreantpos.swing.PosButton(); modifierViewerTable = new com.floreantpos.ui.views.order.modifier.ModifierViewerTable( modifierSelectionModel.getTicketItem()); ticketScrollPane = new PosScrollPane(modifierViewerTable); ticketScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); ticketScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); ticketScrollPane.setPreferredSize(new java.awt.Dimension(180, 200)); createTicketActionPanel(); createTicketItemControlPanel(); JPanel centerPanel = new JPanel(new BorderLayout(5, 5)); centerPanel.add(ticketScrollPane); centerPanel.add(createItemDescriptionPanel(), BorderLayout.NORTH); add(centerPanel); add(ticketActionPanel, BorderLayout.SOUTH); centerPanel.add(ticketItemActionPanel, BorderLayout.EAST); modifierViewerTable.getRenderer().setInTicketScreen(true); modifierViewerTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { updateSelectionView(); } } }); modifierViewerTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { Object selected = modifierViewerTable.getSelected(); if (!(selected instanceof ITicketItem)) { return; } ITicketItem item = (ITicketItem) selected; Boolean printedToKitchen = item.isPrintedToKitchen(); btnDelete.setEnabled(!printedToKitchen); } }); setPreferredSize(new java.awt.Dimension(360, 463)); }
From source file:gdt.jgui.entity.procedure.JProcedurePanel.java
/** * The default constructor.//from w ww .ja va 2 s . c o m */ public JProcedurePanel() { sourcePanel = new JEditorPane(); JScrollPane scrollPaneTop = new JScrollPane(sourcePanel); scrollPaneTop.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Java Source", TitledBorder.CENTER, TitledBorder.TOP)); reportPanel = new JEditorPane(); JScrollPane scrollPaneBottom = new JScrollPane(reportPanel); scrollPaneBottom.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Report", TitledBorder.CENTER, TitledBorder.TOP)); setLayout(new BorderLayout(0, 0)); splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, scrollPaneTop, scrollPaneBottom); splitPane.setDividerLocation(0.5); add(splitPane); splitPane.addComponentListener(new ShowListener()); }
From source file:com.digitalgeneralists.assurance.ui.components.SettingsPanel.java
@Override protected void initializeComponent() { if (!this.initialized) { this.dialogTitle = Application.applicationShortName + " Settings"; // NOTE: There is no notion of add-mode in this dialog. There should // always be a single instance of the application configuration. if (this.configuration == null) { this.configuration = ApplicationConfiguration.createDefaultConfiguration(); }// ww w .j ava 2 s . c o m this.mode = AssuranceDialogMode.EDIT; GridBagLayout gridbag = new GridBagLayout(); this.setLayout(gridbag); final JPanel scanSettingsPanel = new JPanel(); scanSettingsPanel.setLayout(new GridBagLayout()); Border scanSettingsPanelBorder = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED); scanSettingsPanelBorder = BorderFactory.createTitledBorder(scanSettingsPanelBorder, "Scan Settings", TitledBorder.CENTER, TitledBorder.TOP); GridBagConstraints scanSettingsPanelConstraints = new GridBagConstraints(); scanSettingsPanelConstraints.anchor = GridBagConstraints.NORTH; scanSettingsPanelConstraints.fill = GridBagConstraints.HORIZONTAL; scanSettingsPanelConstraints.gridx = 0; scanSettingsPanelConstraints.gridy = 0; scanSettingsPanelConstraints.weightx = 1.0; scanSettingsPanelConstraints.weighty = 1.0; scanSettingsPanelConstraints.gridheight = 1; scanSettingsPanelConstraints.gridwidth = 2; scanSettingsPanelConstraints.insets = new Insets(5, 5, 5, 5); scanSettingsPanel.setBorder(scanSettingsPanelBorder); this.add(scanSettingsPanel, scanSettingsPanelConstraints); GridBagConstraints ignoredFileNamesLabelConstraints = new GridBagConstraints(); ignoredFileNamesLabelConstraints.anchor = GridBagConstraints.NORTHWEST; ignoredFileNamesLabelConstraints.fill = GridBagConstraints.NONE; ignoredFileNamesLabelConstraints.gridx = 0; ignoredFileNamesLabelConstraints.gridy = 0; ignoredFileNamesLabelConstraints.weightx = 1.0; ignoredFileNamesLabelConstraints.weighty = 1.0; ignoredFileNamesLabelConstraints.gridheight = 1; ignoredFileNamesLabelConstraints.gridwidth = 1; ignoredFileNamesLabelConstraints.insets = new Insets(5, 10, 0, 5); final JLabel ignoredFileNamesLabel = new JLabel("Ignored Files", SwingConstants.LEFT); scanSettingsPanel.add(ignoredFileNamesLabel, ignoredFileNamesLabelConstraints); GridBagConstraints ignoredFileNamesTextFieldConstraints = new GridBagConstraints(); ignoredFileNamesTextFieldConstraints.anchor = GridBagConstraints.NORTH; ignoredFileNamesTextFieldConstraints.fill = GridBagConstraints.HORIZONTAL; ignoredFileNamesTextFieldConstraints.gridx = 0; ignoredFileNamesTextFieldConstraints.gridy = 1; ignoredFileNamesTextFieldConstraints.weightx = 1.0; ignoredFileNamesTextFieldConstraints.weighty = 1.0; ignoredFileNamesTextFieldConstraints.gridheight = 1; ignoredFileNamesTextFieldConstraints.gridwidth = 2; ignoredFileNamesTextFieldConstraints.insets = new Insets(2, 5, 5, 5); GridBagConstraints ignoredFileExtensionsLabelConstraints = new GridBagConstraints(); ignoredFileExtensionsLabelConstraints.anchor = GridBagConstraints.NORTHWEST; ignoredFileExtensionsLabelConstraints.fill = GridBagConstraints.NONE; ignoredFileExtensionsLabelConstraints.gridx = 0; ignoredFileExtensionsLabelConstraints.gridy = 2; ignoredFileExtensionsLabelConstraints.weightx = 1.0; ignoredFileExtensionsLabelConstraints.weighty = 1.0; ignoredFileExtensionsLabelConstraints.gridheight = 1; ignoredFileExtensionsLabelConstraints.gridwidth = 1; ignoredFileExtensionsLabelConstraints.insets = new Insets(5, 10, 0, 5); final JLabel ignoredFileExtensionsLabel = new JLabel("Ignored File Extensions", SwingConstants.LEFT); scanSettingsPanel.add(ignoredFileExtensionsLabel, ignoredFileExtensionsLabelConstraints); GridBagConstraints ignoredFileExtensionsTextFieldConstraints = new GridBagConstraints(); ignoredFileExtensionsTextFieldConstraints.anchor = GridBagConstraints.NORTH; ignoredFileExtensionsTextFieldConstraints.fill = GridBagConstraints.HORIZONTAL; ignoredFileExtensionsTextFieldConstraints.gridx = 0; ignoredFileExtensionsTextFieldConstraints.gridy = 3; ignoredFileExtensionsTextFieldConstraints.weightx = 1.0; ignoredFileExtensionsTextFieldConstraints.weighty = 1.0; ignoredFileExtensionsTextFieldConstraints.gridheight = 1; ignoredFileExtensionsTextFieldConstraints.gridwidth = 2; ignoredFileExtensionsTextFieldConstraints.insets = new Insets(2, 5, 5, 5); scanSettingsPanel.add(this.ignoredFileNamesTextField, ignoredFileNamesTextFieldConstraints); this.ignoredFileNamesTextField.getDocument().addDocumentListener(this.textPropertyValidationListener); scanSettingsPanel.add(this.ignoredFileExtensionsTextField, ignoredFileExtensionsTextFieldConstraints); this.ignoredFileExtensionsTextField.getDocument() .addDocumentListener(this.textPropertyValidationListener); GridBagConstraints numberScanThreadsLabelConstraints = new GridBagConstraints(); numberScanThreadsLabelConstraints.anchor = GridBagConstraints.NORTH; numberScanThreadsLabelConstraints.fill = GridBagConstraints.NONE; numberScanThreadsLabelConstraints.gridx = 0; numberScanThreadsLabelConstraints.gridy = 4; numberScanThreadsLabelConstraints.weightx = 1.0; numberScanThreadsLabelConstraints.weighty = 1.0; numberScanThreadsLabelConstraints.gridheight = 1; numberScanThreadsLabelConstraints.gridwidth = 1; numberScanThreadsLabelConstraints.insets = new Insets(10, 5, 0, 5); final JLabel numberOfThreadsLabel = new JLabel("Number of Threads", SwingConstants.RIGHT); scanSettingsPanel.add(numberOfThreadsLabel, numberScanThreadsLabelConstraints); GridBagConstraints numberScanThreadsSpinnerConstraints = new GridBagConstraints(); numberScanThreadsSpinnerConstraints.anchor = GridBagConstraints.NORTHWEST; numberScanThreadsSpinnerConstraints.fill = GridBagConstraints.NONE; numberScanThreadsSpinnerConstraints.gridx = 1; numberScanThreadsSpinnerConstraints.gridy = 4; numberScanThreadsSpinnerConstraints.weightx = 1.0; numberScanThreadsSpinnerConstraints.weighty = 1.0; numberScanThreadsSpinnerConstraints.gridheight = 1; numberScanThreadsSpinnerConstraints.gridwidth = 1; numberScanThreadsSpinnerConstraints.insets = new Insets(5, 5, 5, 5); scanSettingsPanel.add(this.numberScanThreadsSpinner, numberScanThreadsSpinnerConstraints); if (this.configuration != null) { this.ignoredFileNamesTextField.setText(this.configuration.getIgnoredFileNames()); this.ignoredFileExtensionsTextField.setText(this.configuration.getIgnoredFileExtensions()); this.numberScanThreadsSpinner.setValue(this.configuration.getNumberOfScanThreads()); } this.initialized = true; } }