本文整理汇总了Java中javax.swing.JPanel.putClientProperty方法的典型用法代码示例。如果您正苦于以下问题:Java JPanel.putClientProperty方法的具体用法?Java JPanel.putClientProperty怎么用?Java JPanel.putClientProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JPanel
的用法示例。
在下文中一共展示了JPanel.putClientProperty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例4: DiffTopComponent
import javax.swing.JPanel; //导入方法依赖的package包/类
DiffTopComponent (MultiDiffPanelController controller) {
setLayout(new BorderLayout());
this.controller = controller;
JPanel panel = controller.getPanel();
panel.putClientProperty(TopComponent.class, this);
add(panel, BorderLayout.CENTER);
getAccessibleContext().setAccessibleName(NbBundle.getMessage(DiffTopComponent.class, "ACSN_Diff_Top_Component")); // NOI18N
getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(DiffTopComponent.class, "ACSD_Diff_Top_Component")); // NOI18N
}
示例5: 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;
}
示例6: createContainer
import javax.swing.JPanel; //导入方法依赖的package包/类
private JPanel createContainer(ProfilerFeature feature) {
JPanel container = new JPanel(new BorderLayout(0, 0));
container.putClientProperty(ProfilerFeature.class, feature);
JPanel results = feature.getResultsUI();
JPanel xresults = new JPanel(new BorderLayout()) {
public void paint(Graphics g) {
super.paint(g);
if (hintLabel != null) {
Dimension dim = hintLabel.getSize();
int x = (getWidth() - dim.width) / 2;
int y = (getHeight() - dim.height) / 2;
g.setColor(hintColor);
g.fillRect(x - XMAR, y - YMAR, dim.width + XMAR * 2, dim.height + YMAR * 2);
g.setColor(Color.LIGHT_GRAY);
g.drawRect(x - XMAR, y - YMAR, dim.width + XMAR * 2, dim.height + YMAR * 2);
g.translate(x, y);
hintLabel.paint(g);
g.translate(-x, -y);
}
}
};
xresults.add(results, BorderLayout.CENTER);
container.add(xresults, BorderLayout.CENTER);
JPanel settings = feature.getSettingsUI();
if (settings != null) {
JPanel pan = new JPanel(new BorderLayout(0, 0)) {
public void setVisible(boolean visible) {
super.setVisible(visible);
for (Component c : getComponents()) c.setVisible(visible);
}
};
pan.setOpaque(true);
pan.setBackground(UIUtils.getProfilerResultsBackground());
pan.add(settings, BorderLayout.CENTER);
JSeparator sep = UIUtils.createHorizontalLine(pan.getBackground());
pan.add(sep, BorderLayout.SOUTH);
pan.setVisible(settings.isVisible());
container.add(pan, BorderLayout.NORTH);
}
return container;
}