3 Replies Latest reply: Dec 17, 2009 10:07 AM by 843807 RSS

    How do I change variable declaration code in NetBeans GUI builder?

      In the program that I'm writing I need to have a JPanel in a JFrame. It can't be a regular JPanel because I need to override the paintComponents method of the JPanel so I made a class that extends JPanel. It looks something like this:
       public class DrawScreen extends JPanel {
          public DrawScreen () {
              // construct DrawScreen
          public paintComponents (Graphics g) {
              // draw screen
      Now, in the NetBeans GUI builder I can add a JPanel to a JFrame and change the name of the JPanel's variable to myScreen but it declares the variable as
      private javax.swing.JPanel myScreen; 
      when I need it to be
      private DrawScreen myScreen;
      In the inspector I can bring up the Code Customizer for myScreen and it lets me change the initialization
      code but it won't let me change the variable declaration code.

      Anyone know how the make the NetBeans GUI builder let me declare variables my way?

      Edited by: Dr_Morbius on Dec 12, 2009 4:25 PM