You have said the solution. It's possible to make a java application that connects with a web server (servlets) . Then you could create a new game or join to an existing one. But you should have a database connection in server side to store these games. I recommend to look this free web server (
http://www.mycgiserver.com).
I send you a small piece of code which I used to connect with the server in a java application:
// We connect with the server and send "url" string with the query
try
{
URL url_connetion=new URL(url);
HttpURLConnection hc = (HttpURLConnection)url_connetion.openConnection();
in = hc.getInputStream(); // Reading the servelts response
int contentLength = (int)hc.getContentLength();
byte[] raw = new byte[contentLength];
int length = in.read(raw);
in.close();
// Show the response to the user.
String sresponse = new String(raw, 0, length);
return(sresponse);
}
catch (IOException ioe) { };