In order to connect to other computers in Java, you should use Sockets, and define your own Protocol (Basically, your protocol would consist on a handshake, and some way on asking the other part of the connection to send the text’s data). Anyways, I’d recommend you using a simple SQLite database
To read and save files (txt is a raw text file without any special format), check this
If you’d like the program to display the text, you should learn a bit about Java Swing
Also, try looking a bit in google before asking here
solved Upload/Download text files in Java? [closed]