Hello all. I am trying to use java excel code that requires that i use a throwable class along with a main set up like this.

public void t()throws IOException{

  GmailClient newGmailClient = new GmailClient(); 
  newGmailClient.Main();
  newGmailClient.addWindowListener ( newGmailClient );
  newGmailClient.setInputFile("c:/Book12.xls");
  newGmailClient.read();

}

   public static void main(String[] args)throws IOException { {

   GmailClient newGmailClient = new GmailClient();
   newGmailClient.t();



   }

}

the code above is from a program that i got working. I want to combine it with a java form. The code for running that form is below. i cant seen to get a form working unless i run it.

public static void main(String args[]) {
      

            public void run() {
                new NewJFrame().setVisible(true);
        
                
           }
      
            
        });

I need my throwable code to run along with the jframe constructor so that the buttons will work with my throwable code, basically i need to combine the two.

Is there a way to put a throwable class within a run(); ??

I need to do this please help thanks.

ehm ... you don't need to put an entire class somewhere to be able to use it.
you can always instantiate it and use the instance, just like you do it now in your main method in that class