import java.net.*;
import java.io.*;
import java.util.regex.Pattern;
public class AppDev {
public static void main(String[] args) throws Exception {
URL website = new URL("MyWebsite.php");
BufferedReader in = new BufferedReader(
new InputStreamReader(website.openStream()));
String inputLine;
StringBuilder sb = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
System.out.println(inputLine);
sb.append(inputLine);
}
in.close();
}
}
I have this code which reads from a php file and displays this output:
Event Number: 1
Date: 2018-05-16
Time: 12:00:00
Event: meeting with friend
Event Number: 5
Date: 2018-05-03
Time: 01:34:37
Event: what the hell
Event Number: 6
Date: 2018-05-03
Time: 01:35:05
Event: Rage at MySQL
Event Number: 16
Date: 2018-06-20
Time: 08:00:00
Event: hfdhfdfgfg
I would like to split each event and its information by its own in an array for example and then output each array in a jtextfield for example the first entry would be
Event Number: 1
Date: 2018-05-03
Time: 01:34:37
Event: meeting with friend
and so on