StackOverFlow Problem in main() function...
Hi. I tried starting a small frame with a progress indicator while the user waits for the main application to run.
this is the code of my ProgressBar Class
publicclass ProgBarextends JFrame{
JProgressBar bar =new JProgressBar();
public ProgBar()
{
super();
getContentPane().setLayout(new BorderLayout());
getContentPane().add(bar, BorderLayout.CENTER);
bar.setIndeterminate(true);
pack();
}
publicvoid hide()
{
setVisible(false);
dispose();
}
}
and this the code of my main() function
publicstaticvoid main(String[] args)
{
final ProgBar bar =new ProgBar();
bar.setVisible(true);
SwingUtilities.invokeLater(new Runnable(){
publicvoid run(){
System.out.println("Starting application");
Options op =new Options();
OdessaClient oc =new OdessaClient(op);
oc.setVisible(true);
}
});
bar.hide();
}
but I keep getting StackOverflow Errors: Like this:
Exception in thread"main" java.lang.StackOverflowError
at java.awt.Component.show(Component.java:1302)
at java.awt.Component.setVisible(Component.java:1253)
What am I doing wrong?

