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


Java JPanel.putClientProperty方法代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:ResourceWizardPanel.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:AdditionalWizardPanel.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:TestStringWizardPanel.java

示例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
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:DiffTopComponent.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:HardStringWizardPanel.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:47,代码来源:FeaturesView.java


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