本文整理汇总了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));
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}