So konvertieren Sie eine Swing-Applikation zu einem Applet?

Ich erstellt eine desktop-Anwendung mit Swing Application Framework, nun, wie kann ich konvertieren es in ein applet? Die main-Klasse erweitert SingleFrameApplication.

BEARBEITET werden: Dies ist die Start-Klasse, verwendet NetBeans-GUI-builder:

public class PhotoApp extends SingleFrameApplication {

    /**
     * At startup create and show the main frame of the application.
     */
    @Override protected void startup() {
        show(new PhotoView(this));
    }

    /**
     * This method is to initialize the specified window by injecting resources.
     * Windows shown in our application come fully initialized from the GUI
     * builder, so this additional configuration is not needed.
     */
    @Override protected void configureWindow(java.awt.Window root) {
    }

    /**
     * A convenient static getter for the application instance.
     * @return the instance of PhotoUploaderApp
     */
    public static PhotoApp getApplication() {
        return Application.getInstance(PhotoApp.class);
    }

    /**
     * Main method launching the application.
     */
    public static void main(String[] args) {
        launch(PhotoApp.class, args);
    }
}
Waren Sie jemals in der Lage, um dies herauszufinden?
Siehe auch diese hybrid-Konzept.

InformationsquelleAutor fromvega | 2009-03-16

Schreibe einen Kommentar