문제

I am building a JApplet in NetBeans. When the application is initially ran it needs to download some files onto local PC first for it to properly work. Once it is done downloading these files than the GUI should be drawn. How do I pause the JApplet from drawing the GUI until the files are downloaded? Please also note I will need to show the user another GUI that indicates that files are being downloaded, what is the best way of solving this problem? Thank you.

@Override
public void init() {

//THIS IS WHERE THE CODE FOR DOWNLOADING FILES SHOULD BE AND ITS GUI



    /* Create and display the applet */
    try {
        java.awt.EventQueue.invokeAndWait(new Runnable() {

            @Override
            public void run() {
                initComponents();//Draws the main GUI after files have been downloaded
            }
        });

    } catch (Exception ex) {}
}
도움이 되었습니까?

해결책

Sounds like you need a Splash Screen.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top