Presentation is loading. Please wait.

Presentation is loading. Please wait.

Serialization Allows you to turn Java Objects into serial data that can be either save to a file or sent over a network. Usefull for persisting data.

Similar presentations


Presentation on theme: "Serialization Allows you to turn Java Objects into serial data that can be either save to a file or sent over a network. Usefull for persisting data."— Presentation transcript:

1 Serialization Allows you to turn Java Objects into serial data that can be either save to a file or sent over a network. Usefull for persisting data.

2 Serialization Syntax FileOutputStream filOut = new FileOutputStream("gamestate.ser"); ObjectOutputStream out = new ObjectOutputStream(filOut); out.writeObject(gst); out.close(); filOut.close();

3 Deserialization Syntax FileInputStream filIn = new FileInputStream("gamestate.ser"); ObjectInputStream ois = new ObjectInputStream(filIn); gst= (GameState) ois.readObject(); ois.close(); filIn.close();

4 Ant Build Tool Ant is integrated into Eclipse Ant allows you to build, copy files, deploy files, generate jar files, etc.

5 Ant exe-JAR 1/ right-click your project in eclipse project- or package-explorer and select Export 2/ Select the AntBuildfiles from the General directory 3/ accept the defaults, and make sure both check boxes are selected. 4/ Select Window || Show View || Ant 5/ drag your build.xml file into the Ant view. 6/ open up the build.xml file in the editor

6 Ant exe-JAR 7/ add the below target (next slide) within the enclosing tags 8/ save the build.xml. click on the jar target in the Ant view and click run 9/ refresh your project by clicking F5 and you will see the generated executable jar.

7 SwingWorker SwingWorker takes two Object parameters. +The first is the return value and is passed to done() +The second parameter is the progress value and is passed to publish/process. Example: SwingWorker There are three important methods of SwingWorker. +doInBackGround() --background thread +process() -main UI thread +done() -main UI thread


Download ppt "Serialization Allows you to turn Java Objects into serial data that can be either save to a file or sent over a network. Usefull for persisting data."

Similar presentations


Ads by Google