当前位置: 首页>>代码示例>>Java>>正文


Java ListView.setBorder方法代码示例

本文整理汇总了Java中org.openide.explorer.view.ListView.setBorder方法的典型用法代码示例。如果您正苦于以下问题:Java ListView.setBorder方法的具体用法?Java ListView.setBorder怎么用?Java ListView.setBorder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openide.explorer.view.ListView的用法示例。


在下文中一共展示了ListView.setBorder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createListView

import org.openide.explorer.view.ListView; //导入方法依赖的package包/类
private JPanel createListView () {
    JPanel panel = new JPanel();
    // Defined size in #36907 - surrounding controls will add to this size
    // and result is desired 540x400. Note that we can't hardcode size of
    // whole dialog to work correctly with different font size
    panel.setPreferredSize(new Dimension(375, 232));
    panel.setLayout(new BorderLayout());
    listView = new ListView();
    // proper border for the view
    listView.setBorder((Border)UIManager.get("Nb.ScrollPane.border")); // NOI18N
    listView.setPopupAllowed(false);
    listView.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(DocumentsDlg.class, "ACSD_ListView"));
    //view.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    listView.getInputMap( JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT ).put( KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "closeSelected") ;//NOI18N
    listView.getActionMap().put( "closeSelected", new AbstractAction() {//NOI18N
        @Override
        public void actionPerformed( ActionEvent e ) {
            closeDocuments(e );
        }

    });
    panel.add(listView, BorderLayout.CENTER);
    return panel;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:DocumentsDlg.java

示例2: initComponent

import org.openide.explorer.view.ListView; //导入方法依赖的package包/类
private void initComponent() {
    setLayout(new GridBagLayout());
    
    GridBagConstraints cons = new GridBagConstraints();
    cons.gridx = 0;
    cons.gridy = 0;
    cons.weightx = 1.0D;
    cons.fill = GridBagConstraints.HORIZONTAL;
    cons.insets = new Insets(11, 11, 0, 12);
    
    JLabel label = new JLabel();
    Mnemonics.setLocalizedText(label, NbBundle.getMessage(Install.class, "LAB_PendingTasks"));
    
    add(label, cons);
    
    cons.gridy = 1;
    cons.weighty = 1.0D;
    cons.fill = GridBagConstraints.BOTH;
    cons.insets = new Insets(2, 11, 0, 12);
    
    ListView view = new ListView();
    //#66881
    view.setBorder(UIManager.getBorder("Nb.ScrollPane.border"));
    label.setLabelFor(view);
    
    add(view, cons);
    
    view.getAccessibleContext().setAccessibleDescription(
            NbBundle.getMessage(Install.class, "ACSD_PendingTasks"));
    getAccessibleContext().setAccessibleDescription(
            NbBundle.getMessage(Install.class, "ACSD_PendingTitle"));
    
    // set size requested by HIE guys
    Dimension origSize = getPreferredSize();
    setPreferredSize(new Dimension(origSize.width * 5 / 4, origSize.height));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:Install.java

示例3: CategorySelector

import org.openide.explorer.view.ListView; //导入方法依赖的package包/类
CategorySelector() {
    explorerManager = new ExplorerManager();	
    explorerManager.setRootContext(getCategoryRootNode());	
	
    ListView listView = new ListView();
    // Issue 50703 - restore the default scroll pane's border
    JScrollPane scrollPane = new JScrollPane();
    listView.setBorder(scrollPane.getBorder());
    listView.getAccessibleContext().setAccessibleDescription(
        PaletteUtils.getBundleString("ACSD_CTL_PaletteCategories")); // NOI18N
    listView.setPopupAllowed(false);
    listView.setTraversalAllowed(false);
	
    JLabel categoryLabel = new JLabel();
    org.openide.awt.Mnemonics.setLocalizedText(categoryLabel, 
            PaletteUtils.getBundleString("CTL_PaletteCategories")); // NOI18N
    if ((listView.getViewport() != null) && (listView.getViewport().getView() != null)) {
        categoryLabel.setLabelFor(listView.getViewport().getView());
    } else {
        categoryLabel.setLabelFor(listView);
    }

    getAccessibleContext().setAccessibleDescription(
        PaletteUtils.getBundleString("ACSD_PaletteCategoriesSelector")); // NOI18N

    setLayout(new java.awt.BorderLayout(0, 5));
    add(categoryLabel, java.awt.BorderLayout.NORTH);
    add(listView, java.awt.BorderLayout.CENTER);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:CategorySelector.java


注:本文中的org.openide.explorer.view.ListView.setBorder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。