Saturday, 15 March 2014

java - Where should I put my initialisation code? -



java - Where should I put my initialisation code? -

i have written programme in java command line. convert gui used netbeans gui builder. problem not know set initialisation codes(from old main class). there main in gui not think can set there codes. not think not idea. how can run initialisation codes old main class?

i believe have beginnings of netbeans, correct?

/** * @param args command line arguments */ public static void main(string args[]) { ... stuff here automatically created netbeans (leave it). /* create , display form */ java.awt.eventqueue.invokelater(new runnable() { @override public void run() { //enter initialization code here main mainwindow = null; seek { //enter more initialization code here mainwindow = new main(); } grab (ioexception ex) { system.exit(1); } //enter more initialization code here mainwindow.setvisible(true); } }); }

of course, edit like. highly recommend utilize netbeans automated features, if you're new @ creating own guis. re-create , paste code command line app right automated main. hope helps.

java swing netbeans gui-builder

No comments:

Post a Comment