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


Java JPanel.setName方法代码示例

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


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

示例1: createUIComponents

import javax.swing.JPanel; //导入方法依赖的package包/类
private void createUIComponents() {
    final EditorFactory editorFactory = EditorFactory.getInstance();
    previewDocument = editorFactory.createDocument(EMPTY_TEXT);
    previewEditor = editorFactory.createEditor(previewDocument, null, JavaFileType.INSTANCE, true);

    final EditorSettings settings = previewEditor.getSettings();
    settings.setWhitespacesShown(true);
    settings.setLineMarkerAreaShown(false);
    settings.setIndentGuidesShown(false);
    settings.setLineNumbersShown(false);
    settings.setFoldingOutlineShown(false);
    settings.setRightMarginShown(false);
    settings.setVirtualSpace(false);
    settings.setWheelFontChangeEnabled(false);
    settings.setUseSoftWraps(false);
    settings.setAdditionalColumnsCount(0);
    settings.setAdditionalLinesCount(1);

    previewPanel = (JPanel) previewEditor.getComponent();
    previewPanel.setName(PREVIEW_PANEL_NAME);
    previewPanel.setPreferredSize(new Dimension(PREFERRED_PREVIEW_WIDTH, PREFERRED_PREVIEW_HEIGHT));
}
 
开发者ID:t28hub,项目名称:json2java4idea,代码行数:23,代码来源:SettingsPanel.java

示例2: createComponent

import javax.swing.JPanel; //导入方法依赖的package包/类
/** Gets component to display. Implements superclass abstract method. 
 * @return this instance */
protected Component createComponent() {
    JPanel panel = new JPanel(new CardLayout());

    // Accessibility
    panel.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(ResourceWizardPanel.class).getString("ACS_ResourceWizardPanel"));                 
    
    panel.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, Integer.valueOf(1));

    String msgKey = testWizard ? "TXT_SelectTestResource"       //NOI18N
                               : "TXT_SelectResource";          //NOI18N
    panel.setName(NbBundle.getMessage(ResourceWizardPanel.class, msgKey));
    panel.setPreferredSize(I18nWizardDescriptor.PREFERRED_DIMENSION);
    
    panel.add(getUI(), CARD_GUI);

    return panel;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:ResourceWizardPanel.java

示例3: createComponent

import javax.swing.JPanel; //导入方法依赖的package包/类
/** Gets component to display. Implements superclass abstract method. 
 * @return <code>AdditionalPanel</code> instance */
protected Component createComponent() {
    JPanel panel = new JPanel();
    
    //Accessibility
    panel.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(AdditionalWizardPanel.class).getString("ACS_AdditionalWizardPanel"));                    
    
    panel.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, Integer.valueOf(2));
    panel.setName(NbBundle.getBundle(getClass()).getString("TXT_ModifyAdditional"));
    panel.setPreferredSize(I18nWizardDescriptor.PREFERRED_DIMENSION);

    panel.setLayout(new GridBagLayout());
    GridBagConstraints constraints = new GridBagConstraints();
    constraints.weightx = 1.0;
    constraints.weighty = 1.0;
    constraints.fill = GridBagConstraints.BOTH;
    panel.add(getUI(), constraints);
    
    return panel;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:AdditionalWizardPanel.java

示例4: createComponent

import javax.swing.JPanel; //导入方法依赖的package包/类
/** Gets component to display. Implements superclass abstract method. 
 * @return this instance */
protected Component createComponent() {
    JPanel panel = new JPanel(new CardLayout());
    panel.getAccessibleContext().setAccessibleDescription(
            NbBundle.getMessage(
                    TestStringWizardPanel.class,
                    "ACS_TestStringWizardPanel"));              //NOI18N
    
    panel.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX,
                            Integer.valueOf(2));
    panel.setName(
            NbBundle.getMessage(TestStringWizardPanel.class,
                                "TXT_FoundMissingResource"));   //NOI18N
    panel.setPreferredSize(I18nWizardDescriptor.PREFERRED_DIMENSION);                    
    return panel;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:TestStringWizardPanel.java

示例5: getPanel

import javax.swing.JPanel; //导入方法依赖的package包/类
/**
 * set up the thumb image UI
 *
 * @param f
 * @return
 */
JPanel getPanel(final String f) {
    setThumbImage(f);
    JPanel p = new JPanel() {
        @Override
        public void paintComponent(Graphics g) {
            g.drawImage(thumbs.get(f), 0, 0, null);
        }
    };
    p.setPreferredSize(THUMB_SIZE);
    p.setBorder(new LineBorder(Color.LIGHT_GRAY, 3));
    JComponent c = getThumbSelector(f);
    JComponent cl = setupThumbClose(p);
    setupAlignment(p, c, cl);
    p.setName(f);
    p.addMouseListener(thumbselected);
    p.addMouseListener(Listeners.thumbPrevFocus);
    thumbList.add(p);
    return p;
}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:26,代码来源:ImageGallery.java

示例6: wrapEditorComponent

import javax.swing.JPanel; //导入方法依赖的package包/类
protected Component wrapEditorComponent(Component editorComponent) {
    if (cnt++ > 0) {
        fail("Two calls to wrap component");
    }
    
    JPanel panel = new JPanel(new BorderLayout());
    panel.setName(WRAPPER_NAME);
    panel.add(editorComponent, BorderLayout.CENTER);
    return panel;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:WrapEditorComponentTest.java

示例7: wrapEditorComponent

import javax.swing.JPanel; //导入方法依赖的package包/类
@Override
protected Component wrapEditorComponent(Component editor) {
    JPanel container = new JPanel(new BorderLayout());
    container.setName(EDITOR_CONTAINER); // NOI18N
    container.add(editor, BorderLayout.CENTER);
    return container;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:SQLEditorSupport.java

示例8: createComponent

import javax.swing.JPanel; //导入方法依赖的package包/类
/** Gets component to display. Implements superclass abstract method. 
 * @return this instance */
protected Component createComponent() {
    JPanel panel = new JPanel(new CardLayout());
    
    panel.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(HardStringWizardPanel.class).getString("ACS_HardStringWizardPanel"));//NOI18N
    
    panel.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, Integer.valueOf(3));
    panel.setName(NbBundle.getBundle(HardStringWizardPanel.class).getString("TXT_ModifyStrings"));//NOI18N
    panel.setPreferredSize(I18nWizardDescriptor.PREFERRED_DIMENSION);        

    return panel;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:HardStringWizardPanel.java

示例9: createContentDisplayer

import javax.swing.JPanel; //导入方法依赖的package包/类
/**
 * Create the component which will contain the content (the components which
 * correspond to tabs).  The default implementation simply returns a
 * vanilla, unadorned <code>JPanel</code>.
 */
protected JPanel createContentDisplayer() {
    JPanel result = new JPanel();
    result.setName ("Content displayer"); //NOI18N
    return result;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:DefaultTabbedContainerUI.java

示例10: initPanel

import javax.swing.JPanel; //导入方法依赖的package包/类
private void initPanel() {
	this.setLayout(new BorderLayout(20, 5));

	/*Set Description Label*/
	Box label = Box.createVerticalBox();
	label.add(Box.createVerticalStrut(10));
	label.add(new JLabel(CLUSTERING_INFO_DESCRIPTION));
	this.add(label, BorderLayout.NORTH);
	JPanel p1 = new JPanel(new BorderLayout());

	/*Set list of clustering*/
	Box listsPanel = Box.createHorizontalBox();
	listsPanel.add(Box.createHorizontalStrut(10));

	JPanel west = new JPanel(new GridLayout(2, 1, 0, 0));
	west.setPreferredSize(new Dimension(200, 400));

	listsPanel.add(west);
	listsPanel.add(Box.createHorizontalStrut(10));

	JPanel clusting = new JPanel(new BorderLayout(0, 5));

	//La Table del clustering sempre presente e poi aggiunta a seconda del tipo
	clusting.add(new JLabel(HTML_START + HTML_FONT_TITLE + "Clusterings" + HTML_FONT_TIT_END_NO_CAPO + HTML_FONT_NORM), BorderLayout.NORTH);
	clusting.add(new JScrollPane(getClusteringTable(), ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
			ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED), BorderLayout.CENTER);

	west.add(clusting);
	west.add(cluster);
	p1.add(listsPanel, BorderLayout.WEST);

	/*Set Tabbed for statistics*/
	tabbed = new JTabbedPane();
	tabbed.setPreferredSize(new Dimension(600, 400));
	p1.add(tabbed, BorderLayout.CENTER);

	clusingP = new JPanel(new GridLayout(1, 1));
	clusingP.setName("Clustering Info");
	clusingP.setPreferredSize(new Dimension(600, 400));
	tabbed.add(clusingP);

	clustP = new JPanel(new GridLayout(1, 1));
	clustP.setName("Cluster Info");
	clustP.setPreferredSize(new Dimension(600, 400));
	tabbed.add(clustP);

	matrixPanel = new JPanel(new GridLayout(1, 1));
	matrixPanel.setPreferredSize(new Dimension(600, 400));
	matrixPanel.setName("Dispersion Matrix");
	tabbed.add(matrixPanel);

	this.add(p1, BorderLayout.CENTER);
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:54,代码来源:ClusteringInfoPanel.java

示例11: initPanel

import javax.swing.JPanel; //导入方法依赖的package包/类
private void initPanel() {
	this.setLayout(new BorderLayout(20, 5));

	/*Set Description Label*/
	Box label = Box.createVerticalBox();
	label.add(Box.createVerticalStrut(10));
	label.add(new JLabel(CLUSTERING_INFO_DESCRIPTION));
	this.add(label, BorderLayout.NORTH);
	//JPanel p1 = new JPanel(new FlowLayout(FlowLayout.LEFT));
	JPanel p1 = new JPanel(new BorderLayout());

	/*Set list of clustering*/
	Box listsPanel = Box.createHorizontalBox();
	listsPanel.add(Box.createHorizontalStrut(10));

	JPanel west = new JPanel(new GridLayout(2, 1, 0, 0));
	west.setPreferredSize(new Dimension(200, 400));

	listsPanel.add(west);
	listsPanel.add(Box.createHorizontalStrut(10));

	JPanel clusting = new JPanel(new BorderLayout(0, 5));
	//JPanel cluster=new JPanel(new BorderLayout(0,5));

	//La Table del clustering sempre presente e poi aggiunta a seconda del tipo
	clusting.add(new JLabel(HTML_START + HTML_FONT_TITLE + "Clusterings" + HTML_FONT_TIT_END_NO_CAPO + HTML_FONT_NORM), BorderLayout.NORTH);
	clusting.add(new JScrollPane(getClusteringTable(), ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
			ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED), BorderLayout.CENTER);

	//cluster.add(new JLabel(HTML_START
	//		+ HTML_FONT_TITLE +"Num. Of Clusters"+ HTML_FONT_TIT_END_NO_CAPO + HTML_FONT_NORM),BorderLayout.NORTH);
	//cluster.add(new JScrollPane(getClusterTable(),JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED),BorderLayout.CENTER);

	west.add(clusting);
	west.add(cluster);
	p1.add(listsPanel, BorderLayout.WEST);

	/*Set Tabbed for statistics*/
	tabbed = new JTabbedPane();
	tabbed.setPreferredSize(new Dimension(600, 400));
	p1.add(tabbed, BorderLayout.CENTER);

	clusingP = new JPanel(new GridLayout(1, 1));
	clusingP.setName("Clustering Info");
	clusingP.setPreferredSize(new Dimension(600, 400));
	tabbed.add(clusingP);

	clustP = new JPanel(new GridLayout(1, 1));
	clustP.setName("Cluster Info");
	clustP.setPreferredSize(new Dimension(600, 400));
	tabbed.add(clustP);

	matrixPanel = new JPanel(new GridLayout(1, 1));
	matrixPanel.setPreferredSize(new Dimension(600, 400));
	matrixPanel.setName("Dispersion Matrix");
	tabbed.add(matrixPanel);

	this.add(p1, BorderLayout.CENTER);
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:60,代码来源:ClusteringInfoPanel.java


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