I created a quiz maker app in java as a windows application but I don't know how to publish its quizes output as html file or as web application?
The short answer is yes but here is some more context.
So you want to make a web app for the results.
You have a java app which is native windows. First note is Java is platform independent and can be compiled to Windows, Linux, Mac, etc. So the fact that it is windows doesn't mean much. What matters is that what you built would be the server for the web app.
All websites need a server to
serve the html to the browser even if the website is purely static, eg a simple single html file. The server itself simply needs to support HTTP to serve the static HTML files. There are often times two servers involved with a web app. One to simply serve the static HTML site to the browser. A second to
serve the data, usually as JSON with a RESTful API. This can all be done with one as well, its up to you.
Basically you need your Java app to be able to do one of two things:
A: serve dynamically generated html to the browser .
This is what JSP is about. You can do this all with just Java and bit of HTML. This is probably the easier route to take but not as popular.
B: serve the data as JSON/XML with an HTTP endpoint
Whichever of the two options you choose you still need to be able to serve the results of the quiz over HTTP with a Java servlet engine:
The most popular one by far and easiest to use IMHO.
If you need to get your game on.
There are a bunch out there . . .
Once you have chosen an HTTP server, you need a good web platform. There are way too many to choose from so I'll just recommend Spring.io because it's my favorite and massively used in the Java community. However you should really do your homework on this one.
If your app has the logical code and GUI written in the same Java app, you would need to extract the Logical code out. Then the native windows Java app simply imports the core logic and implements it how you do now. The web server Java code would import the same logical code and implement the results part so it can serve the results as an HTTP endpoint. It would not be easy to make a web server and native GUI in the same app.
Once you have your servlet engine and a good web platform you can start serving HTML to the browser. Good luck and remember persistence is key and patience is a virtue. Enjoy the journey.