how to write into a text file in Java

前端 未结 5 1428
南旧
南旧 2021-01-27 01:35

I am doing a project in java and in that i need to add and modify my text file at runtime,which is grouped in the jar.

I am using class.getResourceAsStream(filename) thi

5条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-27 01:59

    If i can't update the text file in jar what other solution is there?

    Store the information in any of:

    1. Cookies
    2. The server
    3. Deploy the applet using 1.6.0_10+, launch it using JWS and use the PersistenceService to store the information. Here is my demo. of the PersistenceService.

    Also, if your users will agree to a trusted applet (which seems overkill for this), you might write the information to a sub-directory of user.home.

提交回复
热议问题