I'm currently developing a JavaSE application. The application reads some exercises from an XML file, and the user has to fill in the answers.

To keep the application flexible, I'd like to avoid to define a fixed format on the questions (like e.g. only multiple choice etc.), but instead add an HTML form for each question to the XML file and use JLabel to display the form.

The form is shown alright (html, form, radiobutton, select[dropdown menue]), but I don't see any way to retrieve the state of the radiobuttons and selection.

Is it at all possible to do this, or am I on the completely wrong track here? Is there another way to achieve the desired behaviour (using HTML forms to define a user interface) for Java standalone applications?