1 Reply Latest reply: Feb 12, 2009 9:39 AM by 843849 RSS

    CDC Development

    843849
      Hello

      I am using netbeans 6.5 for CDC development and I want to develop a simple application which should have more than one form like a login form and then menu and so on
      i tried using 2 JFrames but getting error
      java.lang.UnsupportedOperationException: Cannot create more than one window per graphics device
      Or else
      can anyone tell how to implement such application

      Thank You
        • 1. Re: CDC Development
          843849
          Try to put new form at new panel... not on new frame.
          Jumping from one form to another will be then represented with switching the panels in the same frame.

          something like this:

          JFrame jf; // reference to jour frame



          JPanel jpNew = new JPanel();

          // ... populate new JPanel with swing components ...

          jf.remove(jf.getContentPane()); // remove
          jf.setContentPane(jpNew);
          jf.setVisible(true);