Default
Google

Description

This is a CGI based application which allows you to convert HTML forms into java applet or application. Given input HTML file it generates java1.1 source code as the output. Most of the GUI elements are supported. It generates all the initialisation code for you. It uses very flexible java.awt.GridBagLayout, which you can customise to achieve required results. You can compile and run generated stubs without writing a single line of java code.

HTML Tables to GridBagLayout Converter
File to convert: Or paste Content of the File here
Parsing Options
Close Tags Implicitly
Remove  
Class Attributes
Class Name:
Super Class:

To use it

  1. Create HTML form

  2. There are few rules to follow when creating form.
    1. All components and text should be placed in the table.
    2. Each cell of the table should contain only one input element or text, only first one will be used, others will be ignored silently. Exceptions are checkboxes and radios, you can place text after these elements, and it will be treated as label for the Checkbox.
    3. If you choose to name elements of the form (it is not compulsory), try to avoid following default names for awt components: button, label, text, text_area, list, choice, check, check_group, panel, container, c, font, color. These names are used to create components for which no name was specified, and they may conflict with the names you choose, the program does not attempt to resolve such conflicts. In any case these names aren't very descriptive, and you won't want to use them anyway.
  3. Save your form to the file or paste it in to the textarea

  4. If you prefer to paste the code, rather then uploading file, do not forget to check the checkbox just above the textarea.
  5. Type in the Class name

  6. If class name is supplied the generated code will be a complete java class which can be compiled, and probably run if you choose a super class for it. If the name for the class is not specified, you'll get piece of code which can be pasted in other class.
  7. Select super class

  8. Currently you can choose between Applet and Frame. Panel and Dialog coming soon. Selecting the super class makes your class a subclass of a particular class. Also some additional code is generated to allow simple testing of the class, basically script generates main function, which opens a window with the form inside it.
  9. Choose Parsing Options

  10. There are few of those. Normally you'll be happy with defaults, but sometimes defaults just don't work.
    The most important one is wether to close tags implicitly. I'm not the author of the HTML parser which I used in this script, and do not quite understand how the parsing is done. I have experienced some problems, when converting html files generated in Word97. The HTML tree generated by parser appeared to be broken due to paragraphs, outside and inside of the table, and the problem seemed to go away when the implicit tag closure was turned off. But if you do this, make sure that each tag has corresponding closing tag, except for those which do not suppose to have closing tags at all.
    The other one is wether to remove non-breaking spaces  , they are quite annoying features which some html builders use very often, even where you don't want them. You can ask the script to remove those. Otherwise they appear as strange characters in the code, but the code still compiles and runs fine, at least on my machine.
  11. Press Convert, wait for result, save it to the appropriate file, compile, run

Features

Examples

This html file was used as input, and the following applet was generated. I did not add single line of code.
 

Source Code

The source code is available to those who need it. If you do any modifications which you think can be usefull to other people, I'll be happy to see them.

Acknowledgments


First of all big thanks to ProHosting which provides absolutely free hosting with full CGI support, this is the best hosting I have ever used so far, and I used quite a few.
Many thanks to all those folks who have developed PERL, which makes complex things easy (and is absolutely free),and specially to Gisle Aas who have developed HTML parser, which was used in this script, very extensively.


See Also: Java SOCKS Proxy
 

 
 



 




Acquiring image from ProHosting Banner Exchange