0

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.

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by stultuske
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.