Index: Window_System_API/WizardPanel_java =================================================================== RCS file: /cvs/apisupport/src/org/netbeans/modules/apisupport/resources/templates/Window_System_API/WizardPanel_java,v retrieving revision 1.2 diff -u -r1.2 WizardPanel_java --- Window_System_API/WizardPanel_java 9 May 2001 13:32:55 -0000 1.2 +++ Window_System_API/WizardPanel_java 8 Jan 2002 17:35:57 -0000 @@ -24,48 +24,66 @@ * * @author __USER__ */ -public class __Sample_Wizard__Panel extends javax.swing.JPanel implements WizardDescriptor.Panel /* .FinishPanel */ { +public class __Sample_Wizard__Panel implements WizardDescriptor.Panel /* .FinishPanel */ { - /** Create the wizard panel and set up some basic properties. */ + /** the actual GUI component we are using */ + private VisualPanel visualPanel = null; + + /** Construct the panel implementation. */ public __Sample_Wizard__Panel () { - initComponents (); - // Provide a name in the title bar. - setName (NbBundle.getMessage (__NAME__.class, "TITLE_WizardPanel")); - /* - // Optional: provide a special description for this pane. - // You must have turned on WizardDescriptor.WizardPanel_helpDisplayed - // (see descriptor in standard iterator template for an example of this). - try { - putClientProperty ("WizardPanel_helpURL", // NOI18N - new URL ("nbresloc:/__PACKAGE_AND_NAME_SLASHES$Panel$$somewhere/My__Help.html")); // NOI18N - } catch (MalformedURLException mfue) { - throw new IllegalStateException (mfue.toString ()); - } - */ } // --- VISUAL DESIGN OF PANEL --- - /** This method is called from within the constructor to - * initialize the form. - * WARNING: Do NOT modify this code. The content of this method is - * always regenerated by the Form Editor. + /** The actual GUI component to be displayed in the wizard. + * You may customize its appearance using the Form Editor. */ - private void initComponents() {//GEN-BEGIN:initComponents - setLayout(new java.awt.BorderLayout()); + private class VisualPanel extends javax.swing.JPanel { + + /** Create the wizard panel and set up some basic properties. */ + public VisualPanel () { + initComponents (); + // Provide a name in the title bar. + setName (NbBundle.getMessage (__NAME__.class, "TITLE_WizardPanel")); + /* + // Optional: provide a special description for this pane. + // You must have turned on WizardDescriptor.WizardPanel_helpDisplayed + // (see descriptor in standard iterator template for an example of this). + try { + putClientProperty ("WizardPanel_helpURL", // NOI18N + new URL ("nbresloc:/__PACKAGE_AND_NAME_SLASHES$Panel$$somewhere/My__Help.html")); // NOI18N + } catch (MalformedURLException mfue) { + throw new IllegalStateException (mfue.toString ()); + } + */ + } - }//GEN-END:initComponents + /** This method is called from within the constructor to + * initialize the form. + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ + private void initComponents() {//GEN-BEGIN:initComponents + setLayout(new java.awt.BorderLayout()); - // Variables declaration - do not modify//GEN-BEGIN:variables - // End of variables declaration//GEN-END:variables + }//GEN-END:initComponents + + // Variables declaration - do not modify//GEN-BEGIN:variables + // End of variables declaration//GEN-END:variables + + } // --- WizardDescriptor.Panel METHODS --- - // Get the visual component for the panel. In this template, the same class - // serves as the component and the Panel interface, but you could keep - // them separate if you wished. public Component getComponent () { - return this; + // In some cases can be helpful to be lazy about creating the GUI + // components. They are typically more expensive to create than + // other things, and the wizard descriptor might be created but + // never shown or only partially shown, for example. + if (visualPanel == null) { + visualPanel = new VisualPanel (); + } + return visualPanel; } public HelpCtx getHelp () {