How to handle command line arguments in java Swing Application Framework

I am trying to grab the arguments passed from the command line when starting my application. I have a project executed through netbeans that uses the SingleFrameApplication class or the swing application framework. The main method calls

launch(MyApp.class, args);   

it has the main method. The documentation provided at http://java.sun.com/developer/technicalArticles/javase/swingappfr/ says that:

The start method calls an optional application initialization method just before the start method is called. You can use the initialize method to complete any initial setup or configuration steps. For example, you can process command line arguments from the initialize method. You can also check the connection to the database or set the properties of the system. In short, the framework provides this method for any non-UI installation that your application may need before displaying the user interface. The Application and SingleFrameApplication classes provide an empty method for the initialize method. By default, the method does nothing.

Are we talking about the MyApp.initialize method here? If so, there seems to be no reference to the args parameter.

EDIT: , . , Swing Application Framework, , , "launcher" Java. :

public class MyApp extends SingleFrameApplication {

@Override protected void startup() {
    MyAppGUI view = new MyAppGUI(this);

    show(new MyAppGUI(this));
}

public static void main(String[] args) {
    launch(MyAppGUI.class, args);
}
+5
2

, initialize(...). Code Example 6, initialize(...). .

public class HelloWorld extends SingleFrameApplication {
    ...

    @Override
    protected void initialize(String[] args) {
        ...
    }
}
+2

Sun. .

@Override
protected void initialize(String[] args) {
   ...
}
+1

All Articles