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; }
imageListModel = new DefaultListModel<String>(); imageList = new JList<String>(imageListModel); imageList.setFixedCellWidth(250); imageList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); imagesPanel.add(imageList, new GridBagConstraints(0, 0, 1, 3, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
imageListModel = new DefaultListModel<String>(); imageList = new JList<String>(imageListModel); imageList.setFixedCellWidth(250); imageList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); imagesPanel.add(imageList, new GridBagConstraints(0, 0, 1, 3, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
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); }
@Override public void run() { list.ensureIndexIsVisible(index); // Fix of #10787. // This is workaround for swing bug - BasicListUI doesn't ask for preferred // size of rendered list cell as a result of property selectedIndex change. // It does only on certain JList property changes (e.g. fixedCellWidth). // Maybe subclassing BasicListUI could be better fix. list.setFixedCellWidth(0); list.setFixedCellWidth(-1); } }
imageList.setVisibleRowCount(-1); imageList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); imageList.setFixedCellWidth(240); imageList.setFixedCellHeight(120);
list.setFixedCellWidth(80); list.setFixedCellHeight(80); list.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
private JComponent createPredictorVarListbox() { predictorVarListbox = new JList(new DefaultListModel()); predictorVarListbox.setVisibleRowCount(4); predictorVarListbox.setFixedCellWidth(100); predictorVarListbox.setSelectionMode( ListSelectionModel.SINGLE_SELECTION); predictorVarListbox.setSelectedIndex(0); return new JScrollPane(predictorVarListbox); }
private JComponent createPredictorVarListbox() { predictorVarListbox = new JList(new DefaultListModel()); predictorVarListbox.setVisibleRowCount(4); predictorVarListbox.setFixedCellWidth(100); predictorVarListbox.setSelectionMode( ListSelectionModel.SINGLE_SELECTION); predictorVarListbox.setSelectedIndex(0); //JLabel listboxTitle = new JLabel(" Variables"); //scrollPane.setColumnHeaderView(listboxTitle); //listboxTitle.setBackground(Color.DARK_GRAY); return new JScrollPane(predictorVarListbox); }
private JComponent createVarListbox() { availableVarsList = new JList(new DefaultListModel()); DefaultListModel varsModel = (DefaultListModel) availableVarsList.getModel(); for (String varName : varNames) { varsModel.addElement(varName); } availableVarsList.setVisibleRowCount(5); availableVarsList.setFixedCellWidth(100); availableVarsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); availableVarsList.setSelectedIndex(0); return new JScrollPane(availableVarsList); }
private JComponent createVarListbox() { //varsList = new Vector(varNames); //availableVarsList = new JList(varsList); ORIG availableVarsList = new JList(new DefaultListModel()); DefaultListModel varsModel = (DefaultListModel) availableVarsList.getModel(); for (Object varName : varNames) { varsModel.addElement(varName); } //availableVarsList.setModel(new DefaultListModel()); availableVarsList.setVisibleRowCount(5); availableVarsList.setFixedCellWidth(100); availableVarsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); availableVarsList.setSelectedIndex(0); //JLabel listboxTitle = new JLabel(" Variables"); //scrollPane.setColumnHeaderView(listboxTitle); //listboxTitle.setBackground(Color.DARK_GRAY); return new JScrollPane(availableVarsList); }
JList jlist = new JList(model); jlist.setVisibleRowCount(10); jlist.setFixedCellHeight(15); jlist.setFixedCellWidth(100);
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 NewsHeadlineViewer(NewsStoryViewer storyViewer, Font font, NewsHandler MPHandler) { _filterSelector = new NewsFilterSelector(this); _headlinesList = new Vector<Headline>(); _headlineModel = new DefaultListModel<Headline>(); _headlines = new JList<Headline>(_headlineModel); _headlines.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); _headlines.setFont(font); _headlines.setFixedCellWidth(700); _headlines.addMouseListener(new NewsHeadlineListener(storyViewer, MPHandler)); _scroll = new JScrollPane(_headlines); _scroll.setAutoscrolls(true); }
private void init() throws InvalidClassException { unselectedListModel = new ExtendedDefaultListModel<E>(); unselectedListModel.addElements(unselected); JList<E> unselectedList = new JList<>(unselectedListModel); unselectedList.setFixedCellWidth(200); selectedListModel = new ExtendedDefaultListModel<E>(); selectedListModel.addElements(selected); JList<E> selectedList = new JList<>(selectedListModel); selectedList.setFixedCellWidth(200); JParallelListsPanel<E> parallelLists = new JParallelListsPanel<>( unselectedList, selectedList, unselectedItemsTitle, selectedItemsTitle, false, false ); this.inputComponents.setBorder(createEmptyBorder(5, 5, 5, 5)); this.inputComponents.add(parallelLists, BorderLayout.CENTER); }
private JComponent createPanel() { final JPanel contentPane = new JPanel(new GridBagLayout()); final GridBagConstraints gbc = DialogUtils.createGridBagConstraints(); gbc.gridy++; DialogUtils.addComponent(contentPane, gbc, "Land Cover Model:", landCoverNamesList); gbc.gridy++; externalFileList.setFixedCellWidth(500); DialogUtils.addInnerPanel(contentPane, gbc, new JLabel("External Files"), externalFileList, externalFileBrowseButton); gbc.gridy++; DialogUtils.addComponent(contentPane, gbc, "Resampling Method:", resamplingMethodCombo); gbc.gridy++; gbc.gridx = 1; contentPane.add(new JLabel("Integer data types will use nearest neighbour"), gbc); DialogUtils.fillPanel(contentPane, gbc); return contentPane; }
listaCopia.setFixedCellWidth(100); listaCopia.setFixedCellHeight(15); add(new JScrollPane(listaCopia));
@Override protected ComboPopup createPopup() { return new BasicComboPopup(comboBox) { @Override protected JList createList() { JList list = super.createList(); Object prototypeValue = comboBox.getPrototypeDisplayValue(); if (prototypeValue != null) { ListCellRenderer renderer = comboBox.getRenderer(); Component rendererComponent = renderer .getListCellRendererComponent(list, prototypeValue, 0, false, false); if (rendererComponent instanceof JLabel) { // Preferred size of the renderer itself is (-1,-1) at this point, // so we need this hack Dimension prototypeSize = new JLabel(((JLabel) rendererComponent) .getText()).getPreferredSize(); list.setFixedCellHeight(prototypeSize.height); list.setFixedCellWidth(prototypeSize.width); } } return list; } }; }
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); }
paramList.setFixedCellWidth(200); paramList.setMinimumSize(new Dimension(50, 4));