title: calling args from out side the main method
body: <p>I am developing a client server application where i can invoke server from the remote client and the some string is returned from the client. I am using <code>CORBA</code>. I have a user interface developed by using <code>Java Swing</code> on <code>Netbeans</code>. I need to invoke the server when a button is clicked on the client interface. For that I have to put following code segment inside <code>jButton</code>action listener.</p>
  
  <pre><code>private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
  
  
          try{
          // create and initialize the ORB
          ORB orb = ORB.init(args, null);
  
          // get the root naming context
          org.omg.CORBA.Object objRef = 
              orb.resolve_initial_references("NameService");
          // Use NamingContextExt instead of NamingContext. This is 
          // part of the Interoperable naming Service.  
          NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
  
          // resolve the Object Reference in Naming
          String name = "Hello";
          bsImpl = BubbleSortHelper.narrow(ncRef.resolve_str(name));
  
          //System.out.println("Obtained a handle on server object: " + helloImpl);
          String z = bsImpl.sort(inputFlArray);
          System.out.println(z);
          bsImpl.shutdown();
  
          } catch (Exception e) {
            System.out.println("ERROR : " + e) ;
            e.printStackTrace(System.out);
            }
  
      }   
  </code></pre>
  
  <p>Once I compile it, I get the error saying args cannot be identified. I just copied <code>ORB orb = ORB.init(args, null);</code>  code segment from a place where it was inside the main method. I know that error comes up because of I used args outside the main method. 
  I need to know that how can I initialize <code>ORB</code> object here outside the main method?                     </p>