Java Code Examples for java.awt.event.ItemEvent

The following examples show how to use java.awt.event.ItemEvent. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
static JCheckBox createSettingsToggle(final String parameter, boolean defaultValue, String label, String tooltip) {
	boolean selected = false;
	JCheckBox toggle = new JCheckBox(label);
	toggle.setToolTipText(tooltip);
	selected = WtWindowManager.getInstance().getPropertyBoolean(parameter, defaultValue);
	toggle.setSelected(selected);

	toggle.addItemListener(new ItemListener(){
		@Override
		public void itemStateChanged(ItemEvent e) {
			boolean enabled = (e.getStateChange() == ItemEvent.SELECTED);
			WtWindowManager.getInstance().setProperty(parameter, Boolean.toString(enabled));
		}
	});
	return toggle;
}
 
Example 2
Source Project: openAGV   Source File: DrawingViewPlacardPanel.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates a button to toggle the blocks in the drawing.
 *
 * @param view The DrawingView the button will belong to.
 * @return The created button.
 */
private JToggleButton toggleBlocksButton(final OpenTCSDrawingView drawingView) {
  final JToggleButton toggleButton = new JToggleButton();

  toggleButton.setToolTipText(
      labels.getString("drawingViewPlacardPanel.button_toggleBlocks.tooltipText")
  );

  toggleButton.setIcon(ImageDirectory.getImageIcon("/tree/block.18x18.png"));

  toggleButton.setMargin(new Insets(0, 0, 0, 0));
  toggleButton.setFocusable(false);

  toggleButton.addItemListener(
      (ItemEvent event) -> drawingView.setBlocksVisible(toggleButton.isSelected())
  );

  return toggleButton;
}
 
Example 3
Source Project: openAGV   Source File: DriverGUI.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * If a loopback adapter was chosen, this method initializes the combo boxes
 * with positions the user can set the vehicle to.
 *
 * @param rowIndex An index indicating which row this combo box belongs to
 * @param pointsCellEditor The <code>SingleCellEditor</code> containing
 * the combo boxes.
 */
private void initPointsComboBox(int rowIndex, SingleCellEditor pointsCellEditor) {
  final JComboBox<Point> pointComboBox = new JComboBox<>();

  objectService.fetchObjects(Point.class).stream()
      .sorted(Comparators.objectsByName())
      .forEach(point -> pointComboBox.addItem(point));
  pointComboBox.setSelectedIndex(-1);
  pointComboBox.setRenderer(new StringListCellRenderer<>(x -> x == null ? "" : x.getName()));

  pointComboBox.addItemListener((ItemEvent e) -> {
    Point newPoint = (Point) e.getItem();
    VehicleEntry vehicleEntry = vehicleEntryPool.getEntryFor(getSelectedVehicleName());
    if (vehicleEntry.getCommAdapter() instanceof SimVehicleCommAdapter) {
      SimVehicleCommAdapter adapter = (SimVehicleCommAdapter) vehicleEntry.getCommAdapter();
      adapter.initVehiclePosition(newPoint.getName());
    }
    else {
      LOG.debug("Vehicle {}: Not a simulation adapter -> not setting initial position.",
                vehicleEntry.getVehicle().getName());
    }
  });
  pointsCellEditor.setEditorAt(rowIndex, new DefaultCellEditor(pointComboBox));
}
 
Example 4
Source Project: PacketProxy   Source File: GUIOptionInterceptDialog.java    License: Apache License 2.0 6 votes vote down vote up
private JComponent createDirectionSetting() {
	direction_combo.addItem(InterceptOption.getDirectionAsString(Direction.REQUEST));
	direction_combo.addItem(InterceptOption.getDirectionAsString(Direction.RESPONSE));
	direction_combo.setSelectedIndex(0);
    direction_combo.setEnabled(true);
    direction_combo.setMaximumRowCount(2);
	direction_combo.addItemListener(new ItemListener(){
		@Override
		public void itemStateChanged(ItemEvent event) {
			try {
				if (event.getStateChange() != ItemEvent.SELECTED)
					return;
				String selectedItem = (String)event.getItem();
				updateRelationship(selectedItem);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	});
    return label_and_object(I18nString.get("Direction:"), direction_combo);
}
 
Example 5
Source Project: FoxTelem   Source File: FcdProPlusPanel.java    License: GNU General Public License v3.0 6 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
	if (checkingSettings) return;
	if (e.getSource() == cbMixerGain) {
		if (e.getStateChange() == ItemEvent.DESELECTED) {
			setMixerGain(false);
		} else {
			setMixerGain(true);
		}		
	}
	if (e.getSource() == cbLnaGain) {
		if (e.getStateChange() == ItemEvent.DESELECTED) {
			setLnaGain(false);
		} else {
			setLnaGain(true);
		}
	}
	if (e.getSource() == cbBiasTee ) {

		if (e.getStateChange() == ItemEvent.DESELECTED) {
			setBiasTee(false);
		} else {
			setBiasTee(true);
		}
	}
}
 
Example 6
Source Project: visualvm   Source File: SyntaxTester.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void jCmbLangsItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCmbLangsItemStateChanged
    if (evt.getStateChange() == ItemEvent.SELECTED) {
        String lang = jCmbLangs.getSelectedItem().toString();

        // save the state of the current JEditorPane, as it's Document is about
        // to be replaced.
        String t = jEdtTest.getText();
        int caretPosition = jEdtTest.getCaretPosition();
        Rectangle visibleRectangle = jEdtTest.getVisibleRect();

        // install a new DefaultSyntaxKit on the JEditorPane for the requested language.
        jEdtTest.setContentType(lang);

        // restore the state of the JEditorPane - note that installing a new
        // EditorKit causes the Document to be recreated.
        SyntaxDocument sDoc = (SyntaxDocument) jEdtTest.getDocument();
        jEdtTest.setText(t);
        sDoc.clearUndos();
        jEdtTest.setCaretPosition(caretPosition);
        jEdtTest.scrollRectToVisible(visibleRectangle);
    }
}
 
Example 7
@Override
public void itemStateChanged( final ItemEvent arg0 )
{
	boolean oldState = lookForMaxima;
	
	if ( arg0.getStateChange() == ItemEvent.DESELECTED )				
		lookForMaxima = false;			
	else if ( arg0.getStateChange() == ItemEvent.SELECTED  )
		lookForMaxima = true;
	
	if ( lookForMaxima != oldState )
	{
		while ( isComputing )
			SimpleMultiThreading.threadWait( 10 );
		
		updatePreview( ValueChange.MINMAX );
	}
}
 
Example 8
Source Project: proxyee-down   Source File: CheckboxMenuItemGroup.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
  CheckboxMenuItem checkedItem = ((CheckboxMenuItem) e.getSource());
  if (e.getStateChange() == ItemEvent.SELECTED) {
    String selectedItemName = checkedItem.getName();
    for (CheckboxMenuItem item : items) {
      if (!item.getName().equals(selectedItemName)) {
        item.setState(false);
      }
    }
    if (itemListener != null) {
      itemListener.itemStateChanged(e);
    }
  } else {
    checkedItem.setState(true);
  }
}
 
Example 9
/**
 * (Re-)creates the type menu with the selected type
 * @param selected the selected column Type
 */
private void updateTypeMenu(String selected) {
	typeMenu.removeAll();
	ButtonGroup typeGroup = new ButtonGroup();
	for (ColumnType columnType : ColumnType.values()) {
		String columnTypeName = DataImportWizardUtils.getNameForColumnType(columnType);
		JCheckBoxMenuItem checkboxItem = new JCheckBoxMenuItem(columnTypeName);
		if (columnTypeName.equals(selected)) {
			checkboxItem.setSelected(true);
		}
		checkboxItem.addItemListener(e -> {
			if (e.getStateChange() == ItemEvent.SELECTED) {
				changeType(columnType);
			}
		});
		typeGroup.add(checkboxItem);
		typeMenu.add(checkboxItem);
	}
}
 
Example 10
Source Project: megamek   Source File: CustomMechDialog.java    License: GNU General Public License v2.0 6 votes vote down vote up
public void itemStateChanged(ItemEvent itemEvent) {
    if (itemEvent.getSource().equals(choStartingMode)) {
        updateStartingModeOptions();
    }
    if (itemEvent.getSource().equals(chDeployProne)) {
        chDeployHullDown.setSelected(false);
        return;
    }
    if (itemEvent.getSource().equals(chDeployHullDown)) {
        chDeployProne.setSelected(false);
        return;
    }
    if (itemEvent.getSource().equals(choDeploymentRound)) {
        if (choDeploymentRound.getSelectedIndex() == 0) {
            choDeploymentZone.setEnabled(false);
            choDeploymentZone.setSelectedIndex(0);
        } else {
            choDeploymentZone.setEnabled(true);
        }
    }
}
 
Example 11
private void makePathButton() {
        btnPath = new TextFieldWithBrowseButton();
        btnPath.setText(PackageTemplateHelper.getRootDirPath());
        btnPath.addBrowseFolderListener(Localizer.get("SelectPackageTemplate"), "", project, FileReaderUtil.getPackageTemplatesDescriptor());

//        panel.add(new SeparatorComponent(), new CC().growX().spanX().wrap());
        panel.add(btnPath, new CC().pushX().growX().spanX());
        addPathButtons();

        rbFromPath = new JBRadioButton(Localizer.get("label.FromPath"));
        rbFromPath.addItemListener(e -> {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                toggleSourcePath(
                        TemplateSourceType.PATH,
                        null,
                        btnPath
                );
            }
        });

        panel.add(rbFromPath, new CC().growX().spanX().wrap());
    }
 
Example 12
Source Project: netbeans   Source File: ColorComboBox.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Initialize the combo with given list of Colors.
 * @param values Color values.
 * @param names Name of colors.
 * @param allowCustomColors True to allow users to pick a custom colors,
 * false if user can choose from given colors only.
 */
public ColorComboBox( Color[] values, String[] names, boolean allowCustomColors ) {
    super.setModel( createModel(values, names, allowCustomColors) );
    this.allowCustomColors = allowCustomColors;
    setEditable( false );
    setRenderer( new ColorComboBoxRendererWrapper( this ) );
    if( allowCustomColors ) {
        addItemListener( new ItemListener() {

            @Override
            public void itemStateChanged( ItemEvent e ) {
                if( e.getStateChange() == ItemEvent.SELECTED ) {
                    SwingUtilities.invokeLater( new Runnable() {
                        @Override
                        public void run() {
                            if( getSelectedItem() == ColorValue.CUSTOM_COLOR ) {
                                pickCustomColor();
                            }
                            lastSelection = ( ColorValue ) getSelectedItem();
                        }
                    } );
                }
            }
        });
    }
}
 
Example 13
Source Project: darklaf   Source File: TristateButtonModel.java    License: MIT License 5 votes vote down vote up
public void setState(final TristateState state) {
    if (this.state == state) return;
    this.state = state;
    displayState();
    fireStateChanged();
    int indeterminate = 3;
    // noinspection MagicConstant
    fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, this, indeterminate));
}
 
Example 14
Source Project: chipster   Source File: InputFileComponent.java    License: MIT License 5 votes vote down vote up
private void initListener(InputParameters inputParameters) {
       choiceBox.addItemListener(new ItemListener() {
		@Override
		public void itemStateChanged(ItemEvent e) {
			if (e.getStateChange() == ItemEvent.DESELECTED) {
                /* deselection happens only when the data is selected in some 
                 * other comboBox and in this case that comboBox will set the
                 * new data bindings
                 */
            } else {
            	inputParameters.bind((DataBean)e.getItem(), e.getSource());
            }
		}
	});
}
 
Example 15
Source Project: jdk8u60   Source File: DrawTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
    if (e.getSource() instanceof Checkbox) {
        target.setForeground(((Component) e.getSource()).getForeground());
    } else if (e.getSource() instanceof Choice) {
        String choice = (String) e.getItem();
        if (choice.equals("Lines")) {
            target.setDrawMode(DrawPanel.LINES);
        } else if (choice.equals("Points")) {
            target.setDrawMode(DrawPanel.POINTS);
        }
    }
}
 
Example 16
Source Project: magarena   Source File: DeckChooserDialog.java    License: GNU General Public License v3.0 5 votes vote down vote up
private void addDeckTypeComboBoxListener() {
    deckTypeCombo.addItemListener(e -> {
        if (e.getStateChange() == ItemEvent.SELECTED) {
            SwingUtilities.invokeLater(() -> {
                setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                decksPanel.setDeckType((DeckType) e.getItem());
                setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            });
        }
    });
}
 
Example 17
Source Project: openAGV   Source File: DriverGUI.java    License: Apache License 2.0 5 votes vote down vote up
private void initCommAdaptersComboBox(VehicleEntry vehicleEntry,
                                      int rowIndex,
                                      SingleCellEditor adapterCellEditor) {
  final CommAdapterComboBox comboBox = new CommAdapterComboBox();
  commAdapterRegistry.findFactoriesFor(vehicleEntry.getVehicle())
      .forEach(factory -> comboBox.addItem(factory));
  // Set the selection to the attached comm adapter, (The vehicle is already attached to a comm
  // adapter due to auto attachment on startup.)
  comboBox.setSelectedItem(vehicleEntry.getCommAdapterFactory());
  comboBox.setRenderer(new AdapterFactoryCellRenderer());
  comboBox.addPopupMenuListener(new BoundsPopupMenuListener());
  comboBox.addItemListener((ItemEvent evt) -> {
    if (evt.getStateChange() == ItemEvent.DESELECTED) {
      return;
    }

    // If we selected a comm adapter that's already attached, do nothing.
    if (Objects.equals(evt.getItem(), vehicleEntry.getCommAdapterFactory())) {
      LOG.debug("{} is already attached to: {}", vehicleEntry.getVehicleName(), evt.getItem());
      return;
    }

    int reply = JOptionPane.showConfirmDialog(
        null,
        bundle.getString("CommAdapterComboBox.confirmation.driverChange.text"),
        bundle.getString("CommAdapterComboBox.confirmation.driverChange.title"),
        JOptionPane.YES_NO_OPTION);
    if (reply == JOptionPane.NO_OPTION) {
      return;
    }

    attachManager.attachAdapterToVehicle(getSelectedVehicleName(),
                                         (VehicleCommAdapterFactory) comboBox.getSelectedItem());
  });
  adapterCellEditor.setEditorAt(rowIndex, new DefaultCellEditor(comboBox));

  vehicleEntry.addPropertyChangeListener(comboBox);
}
 
Example 18
Source Project: hprof-tools   Source File: ScreenInfoPanel.java    License: MIT License 5 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent itemEvent) {
    if (itemEvent.getSource() == rootPicker) {
        selectedScreen = ((Screen) itemEvent.getItem());
        update();
    }
    else if (itemEvent.getSource() == showBoundsBox) {
        renderer.setShowBounds(showBoundsBox.isSelected());
        updateImage(false);
    }
    else if (itemEvent.getSource() == forceAlpha) {
        renderer.setForceBackgroundTransparency(forceAlpha.isSelected());
        updateImage(false);
    }
}
 
Example 19
private void onColumnSelected(ItemEvent e, JComboBox cboColumns)
{
   if (null == e || ItemEvent.SELECTED == e.getStateChange())
   {
      ColumnComboModel selectedColumn = (ColumnComboModel) cboColumns.getSelectedItem();
      _chartConfigPanelTab.cboYAxisKind.setModel(new DefaultComboBoxModel(ChartConfigMode.getAvailableValues(selectedColumn.getColumnDisplayDefinition(), _chartConfigPanelTabMode,s_stringMgr)));
   }
}
 
Example 20
Source Project: jdk8u60   Source File: LWChoicePeer.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public void itemStateChanged(final ItemEvent e) {
    // AWT Choice sends SELECTED event only whereas JComboBox
    // sends both SELECTED and DESELECTED.
    if (e.getStateChange() == ItemEvent.SELECTED) {
        synchronized (getDelegateLock()) {
            if (skipPostMessage) {
                return;
            }
            getTarget().select(getDelegate().getSelectedIndex());
        }
        postEvent(new ItemEvent(getTarget(), ItemEvent.ITEM_STATE_CHANGED,
                                e.getItem(), ItemEvent.SELECTED));
    }
}
 
Example 21
Source Project: freecol   Source File: FreeColMenuTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
    JMenuItem source = (JMenuItem)(e.getSource());
    String s = "Item event detected."
               + newline
               + "    Event source: " + source.getText()
               + " (an instance of " + getClassName(source) + ")"
               + newline
               + "    New state: "
               + ((e.getStateChange() == ItemEvent.SELECTED) ?
                 "selected":"unselected");
    output.append(s + newline);
    output.setCaretPosition(output.getDocument().getLength());
}
 
Example 22
public void handleAction(final boolean state) {
    final CheckboxMenuItem target = (CheckboxMenuItem)this.target;
    WToolkit.executeOnEventHandlerThread(target, new Runnable() {
        @Override
        public void run() {
            target.setState(state);
            postEvent(new ItemEvent(target, ItemEvent.ITEM_STATE_CHANGED,
                                    target.getLabel(), (state)
                                      ? ItemEvent.SELECTED
                                      : ItemEvent.DESELECTED));
        }
    });
}
 
Example 23
JMenu makeStopOptionsMenu()
{
  return new JMenu(Strings.get("menu_stopOptions")) {
    private static final long serialVersionUID = 1L;

    {
      setToolTipText(Strings.get("menu_stopOptions.descr"));

      final ItemListener itemListener = new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e)
        {
          updateNameOfActionStopBundles();
        }
      };

      itemStopOptionsTransient =
        new JCheckBoxMenuItem(Strings.get("stop_option_transient"), false);
      itemStopOptionsTransient.setToolTipText(Strings
          .get("stop_option_transient.descr"));
      itemStopOptionsTransient.addItemListener(itemListener);

      add(itemStopOptionsTransient);
      updateNameOfActionStopBundles();
    }
  };
}
 
Example 24
Source Project: gcs   Source File: DisplayPreferences.java    License: Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent event) {
    Object source = event.getSource();
    if (source == mIncludeUnspentPointsInTotal) {
        Preferences.getInstance().setIncludeUnspentPointsInTotal(mIncludeUnspentPointsInTotal.isSelected());
    } else if (source == mShowCollegeInSheetSpells) {
        Preferences.getInstance().setShowCollegeInSheetSpells(mShowCollegeInSheetSpells.isSelected());
    }
    adjustResetButton();
}
 
Example 25
Source Project: openjdk-8-source   Source File: WChoicePeer.java    License: GNU General Public License v2.0 5 votes vote down vote up
void handleAction(final int index) {
    final Choice c = (Choice)target;
    WToolkit.executeOnEventHandlerThread(c, new Runnable() {
        public void run() {
            c.select(index);
            postEvent(new ItemEvent(c, ItemEvent.ITEM_STATE_CHANGED,
                            c.getItem(index), ItemEvent.SELECTED));
        }
    });
}
 
Example 26
Source Project: netbeans   Source File: JSFTargetPanelProvider.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected int initSyntaxButton(int gridy ,final TargetChooserPanel<FileType> panel ,
        final TargetChooserPanelGUI<FileType> uiPanel) 
{
    myFaceletsSyntaxButton = new JRadioButton();
    
    GridBagConstraints gridBagConstraints = new GridBagConstraints();
    myFaceletsSyntaxButton.setSelected(true);
    getSegmentBox().setEnabled(false);
    myFaceletsSyntaxButton.setMnemonic(NbBundle.getMessage(
            JSFTargetPanelProvider.class, "A11Y_Facelets_mnem").charAt(0));
    getButtonGroup().add(myFaceletsSyntaxButton);
    myFaceletsSyntaxButton.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(ItemEvent evt) {
            checkBoxChanged(evt, panel , uiPanel);
        }
    });

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = gridy++;
    gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 0);
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    getOptionPanel().add(myFaceletsSyntaxButton,gridBagConstraints);
    
    getJspSyntaxButton().setMnemonic(NbBundle.getMessage(
            JSFTargetPanelProvider.class, "A11Y_JspStandard_mnem").charAt(0));
    return gridy;
}
 
Example 27
Source Project: netbeans   Source File: StatisticsPanel.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
    switch(e.getStateChange()) {
        case ItemEvent.SELECTED:
            filterMask &= ~itemMask;
            break;
        case ItemEvent.DESELECTED:
            filterMask |= itemMask;
            break;
        default:
            return;
    }
    treePanel.setFilterMask(filterMask);
    NbPreferences.forModule(StatisticsPanel.class).putInt(KEY_FILTER_MASK, filterMask);
}
 
Example 28
Source Project: jdk8u-jdk   Source File: WChoicePeer.java    License: GNU General Public License v2.0 5 votes vote down vote up
void handleAction(final int index) {
    final Choice c = (Choice)target;
    WToolkit.executeOnEventHandlerThread(c, new Runnable() {
        @Override
        public void run() {
            c.select(index);
            postEvent(new ItemEvent(c, ItemEvent.ITEM_STATE_CHANGED,
                            c.getItem(index), ItemEvent.SELECTED));
        }
    });
}
 
Example 29
Source Project: netbeans   Source File: TransferSelector.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void itemStateChanged(ItemEvent e) {
    if (e.getStateChange() == ItemEvent.SELECTED) {
        model.selectAll();
        treeView.repaintTree();
    } else if (e.getStateChange() == ItemEvent.DESELECTED) {
        model.unselectAll();
        treeView.repaintTree();
    }
}
 
Example 30
Source Project: zap-extensions   Source File: PayloadPreviewPanel.java    License: Apache License 2.0 5 votes vote down vote up
private static JPanel createSplitPanel(
        JPanel leftPanel,
        JPanel rightPanel,
        final SyncScrollBarsAdjustmentListener syncScrollPanes) {
    JPanel panel = new JPanel();

    GroupLayout layout = new GroupLayout(panel);
    panel.setLayout(layout);
    layout.setAutoCreateGaps(true);

    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPanel, rightPanel);
    splitPane.setDividerLocation(0.5D);
    splitPane.setResizeWeight(0.5D);

    JCheckBox syncScrollBarsCheckbox = new JCheckBox(LOCK_SCROLL_BARS_BUTTON_LABEL);
    syncScrollBarsCheckbox.setSelected(true);
    syncScrollBarsCheckbox.addItemListener(
            new ItemListener() {

                @Override
                public void itemStateChanged(ItemEvent e) {
                    syncScrollPanes.setSync(e.getStateChange() == ItemEvent.SELECTED);
                }
            });

    layout.setHorizontalGroup(
            layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addComponent(splitPane)
                    .addComponent(syncScrollBarsCheckbox));
    layout.setVerticalGroup(
            layout.createSequentialGroup()
                    .addComponent(splitPane)
                    .addComponent(syncScrollBarsCheckbox));

    return panel;
}