private JComponent createXPathResultPanel() { xpathResults.addElement("No XPath results yet, run an XPath Query first."); xpathResultList.setBorder(BorderFactory.createLineBorder(Color.black)); xpathResultList.setFixedCellWidth(300); xpathResultList.setCellRenderer(new ASTListCellRenderer()); xpathResultList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); xpathResultList.getSelectionModel().addListSelectionListener(new ASTSelectionListener()); JScrollPane scrollPane = new JScrollPane(); scrollPane.getViewport().setView(xpathResultList); return scrollPane; }
public DFAPanel() { super(); setLayout(new BorderLayout()); JPanel leftPanel = new JPanel(); nodeList = new JList(nodes); nodeList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); nodeList.setFixedCellWidth(150); nodeList.setBorder(BorderFactory.createLineBorder(Color.black)); nodeList.addListSelectionListener(this); leftPanel.add(nodeList); add(leftPanel, BorderLayout.WEST); dfaCanvas = new DFACanvas(); dfaCanvas.setBackground(Color.WHITE); dfaCanvas.setPreferredSize(new Dimension(900, 1400)); JScrollPane scrollPane = new JScrollPane(dfaCanvas); add(scrollPane, BorderLayout.CENTER); }
/** {@inheritDoc} */ @Override public JPanel createControlPanel() { JPanel panel = new JPanel(new BorderLayout()); categoryList = new JList(new CategoryListModel()); categoryList.setPreferredSize(new Dimension(LIST_WIDTH, DEFAULT_HEIGHT)); categoryList.setBorder(BorderFactory.createTitledBorder("Categories")); categoryList.addListSelectionListener( new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { showInfo(categoryList.getSelectedIndex()); } }); panel.add(categoryList, BorderLayout.WEST); textArea = new JTextArea(); textArea.setPreferredSize(new Dimension(TEXT_AREA_WIDTH, DEFAULT_HEIGHT)); textArea.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); textArea.setLineWrap(true); textArea.setEditable(false); panel.add(textArea, BorderLayout.CENTER); categoryList.setSelectedIndex(0); return panel; }
listPane.setPreferredSize(new Dimension(CONTROL_WIDTH, 300)); listBox.setBorder(BorderFactory.createEtchedBorder()); listBox.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
categories.setSelectedIndex(0); categories.setBorder(BorderFactory.createLineBorder(HelperUi.COLOR_COMPONENT_BORDER)); categories.addListSelectionListener(e -> { PanelPreferences.this.remove(borderLayoutPreferences.getLayoutComponent(BorderLayout.CENTER));
Object child = comboBox.getAccessibleContext().getAccessibleChild(0); BasicComboPopup popup = (BasicComboPopup)child; JList list = popup.getList(); list.setBorder( whiteBorder );
rows.setSelectedIndex(0); rows.setFont(new Font("Times New Roman", 1, 17)); rows.setBorder(BorderFactory.createEmptyBorder()); rows.addMouseWheelListener(this);
private void populateMimeList() { originalMimeListModel = new DefaultListModel(); for (String mime : mimeMap.keySet()) { originalMimeListModel.addElement(mime); } mimeList = new JList(originalMimeListModel); mimeList.setBorder(BorderFactory.createTitledBorder("All Mime Types")); mimeList.addListSelectionListener(new ListSelectionListener() { // when a mime type is selected remember what it is public void valueChanged(ListSelectionEvent e) { Object selectedValue = mimeList.getSelectedValue(); selectedMime = (String) selectedValue; } }); }
@Override public void setBorder(Border border) { super.setBorder(border); MultiColumnList.this.setBorder(border); }
public ClassListItem(Class<? extends T1> clz) { this.clz = clz; }
private JComponent createXPathResultPanel() { xpathResults.addElement("No XPath results yet, run an XPath Query first."); xpathResultList.setBorder(BorderFactory.createLineBorder(Color.black)); xpathResultList.setFixedCellWidth(300); xpathResultList.setCellRenderer(new ASTListCellRenderer()); xpathResultList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); xpathResultList.getSelectionModel().addListSelectionListener(new ASTSelectionListener()); JScrollPane scrollPane = new JScrollPane(); scrollPane.getViewport().setView(xpathResultList); return scrollPane; }
private void createSuggestionList(List<String> entries) { if (list == null) { list = new JList<>(entries.toArray(new String[entries.size()])); list.setDoubleBuffered(true); list.setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY, 0)); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); list.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { insertSelection(); } } }); } else { list.removeAll(); list.setListData(entries.toArray(new String[entries.size()])); } list.setSelectedIndex(0); }
private void initComponents() { styleEditorList = new javax.swing.JList(); setLayout(new java.awt.BorderLayout()); setMinimumSize(new java.awt.Dimension(80, 200)); setOpaque(false); styleEditorList.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2)); styleEditorList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); styleEditorList.addListSelectionListener(new javax.swing.event.ListSelectionListener() { public void valueChanged(javax.swing.event.ListSelectionEvent evt) { styleEditorListValueChanged(evt); } }); add(styleEditorList, java.awt.BorderLayout.NORTH); styleEditorList.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(StyleEditorListPanel.class, "STYLE_EDITOR_LIST_ACCESSIBLE_NAME")); styleEditorList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(StyleEditorListPanel.class, "STYLE_EDITOR_LIST_ACCESSIBLE_DESC")); }// </editor-fold>//GEN-END:initComponents
public DFAPanel() { super(); setLayout(new BorderLayout()); JPanel leftPanel = new JPanel(); nodeList = new JList(nodes); nodeList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); nodeList.setFixedCellWidth(150); nodeList.setBorder(BorderFactory.createLineBorder(Color.black)); nodeList.addListSelectionListener(this); leftPanel.add(nodeList); add(leftPanel, BorderLayout.WEST); dfaCanvas = new DFACanvas(); dfaCanvas.setBackground(Color.WHITE); dfaCanvas.setPreferredSize(new Dimension(900, 1400)); JScrollPane scrollPane = new JScrollPane(dfaCanvas); add(scrollPane, BorderLayout.CENTER); }
public CheckBoxParameterComponent( final ListParameter listParameter, final ParameterUpdateContext updateContext, final ParameterContext parameterContext ) { super( listParameter, updateContext, parameterContext ); getList().setOpaque( false ); getList().setBorder( null ); getList().setCellRenderer( new ComponentListCellRenderer( JCheckBox.class ) ); } }
public RadioButtonParameterComponent( final ListParameter listParameter, final ParameterUpdateContext updateContext, final ParameterContext parameterContext ) { super( listParameter, updateContext, parameterContext ); getList().setOpaque( false ); getList().setBorder( null ); getList().setCellRenderer( new ComponentListCellRenderer( JRadioButton.class ) ); } }
/** * Configures the list which is used to hold the combo box items in the * popup. This method is called when the UI class is created. */ @Override protected void configureList() { list.setFont(comboBox.getFont()); list.setBorder(null); list.setCellRenderer(comboBox.getRenderer()); list.setFocusable(false); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); int selectedIndex = comboBox.getSelectedIndex(); if (selectedIndex == -1) { list.clearSelection(); } else { list.setSelectedIndex(selectedIndex); list.ensureIndexIsVisible(selectedIndex); } installListListeners(); }
mappingsList.setBorder(new TitledBorder(Bundle.ShapePropertyMappingsPanel_list_title()));
/** * Configures the list which is used to hold the combo box items in the * popup. This method is called when the UI class is created. * * @see #createList */ protected void configureList() { list.setFont(comboBox.getFont()); list.setForeground(comboBox.getForeground()); list.setBackground(comboBox.getBackground()); list.setSelectionForeground(UIManager .getColor("ComboBox.selectionForeground")); list.setSelectionBackground(UIManager .getColor("ComboBox.selectionBackground")); list.setBorder(null); list.setCellRenderer(comboBox.getRenderer()); list.setFocusable(false); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); setListSelection(comboBox.getSelectedIndex()); installListListeners(); }
public ButtonParameterComponent( final ListParameter listParameter, final ParameterUpdateContext updateContext, final ParameterContext parameterContext ) { super( listParameter, updateContext, parameterContext ); getList().setOpaque( false ); getList().setBorder( null ); getList().setCellRenderer( new ComponentListCellRenderer( JToggleButton.class ) ); //Allow JList to handle scrolls getList().setPreferredSize( null ); setHorizontalScrollBarPolicy( HORIZONTAL_SCROLLBAR_AS_NEEDED ); } }