Java Code Examples for javax.swing.JPanel.setName()

The following are Jave code examples for showing how to use setName() of the javax.swing.JPanel class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: json2java4idea   File: SettingsPanel.java   View Source Code Vote up 7 votes
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));
}
 
Example 2
Project: incubator-netbeans   File: ResourceWizardPanel.java   View Source Code Vote up 6 votes
/** 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;
}
 
Example 3
Project: incubator-netbeans   File: AdditionalWizardPanel.java   View Source Code Vote up 6 votes
/** 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;
}
 
Example 4
Project: incubator-netbeans   File: TestStringWizardPanel.java   View Source Code Vote up 6 votes
/** 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;
}
 
Example 5
Project: Cognizant-Intelligent-Test-Scripter   File: ImageGallery.java   View Source Code Vote up 6 votes
/**
 * 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;
}
 
Example 6
Project: incubator-netbeans   File: WrapEditorComponentTest.java   View Source Code Vote up 5 votes
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;
}
 
Example 7
Project: incubator-netbeans   File: SQLEditorSupport.java   View Source Code Vote up 5 votes
@Override
protected Component wrapEditorComponent(Component editor) {
    JPanel container = new JPanel(new BorderLayout());
    container.setName(EDITOR_CONTAINER); // NOI18N
    container.add(editor, BorderLayout.CENTER);
    return container;
}
 
Example 8
Project: incubator-netbeans   File: HardStringWizardPanel.java   View Source Code Vote up 5 votes
/** 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;
}
 
Example 9
Project: incubator-netbeans   File: DefaultTabbedContainerUI.java   View Source Code Vote up 4 votes
/**
 * 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;
}
 
Example 10
Project: jmt   File: ClusteringInfoPanel.java   View Source Code Vote up 4 votes
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);
}
 
Example 11
Project: QN-ACTR-Release   File: ClusteringInfoPanel.java   View Source Code Vote up 4 votes
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);
}