Is it possible to mimic a submission of html form in Java Swing

Helppp!!!!
I want to create a swing applet (The plugins are installed) that would submit to a servlet. The servlet is having a doPost method. Now How do I form fields (that is textfield, hidden field) in a swing environment.
The same attempt if made in a normal HTML document, I get the results.
But how to do it swing environment.
I have seen classes called FormView, HTMLDocument etc in javax.swing.text.html package. The documentation also says that a input type=button will be intrepreted as JButton. There is also a method called as "submitData()" in the FormView class.
But how actually do you use it.
Or is there any other way.
Can anyone help me out please?
Thank you
MrWrongBoy

You could simply let the JTextPane load up an HTML page with a form for you which in turn you can fill out and submit to your servlet. And here is my working sample:
public class HTMLFormJApplet extends javax.swing.JApplet {
    public void init() {
        initComponents();
        htmlPane.setEditable(false);
        String page_name = getParameter("page_name");
        try
            htmlPane.setPage(new java.net.URL(getDocumentBase(),page_name).toExternalForm());
        catch(Exception e)
            e.printStackTrace();
    private void initComponents() {
        jScrollPane1 = new javax.swing.JScrollPane();
        htmlPane = new javax.swing.JTextPane();
        jScrollPane1.setViewportView(htmlPane);
        getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextPane htmlPane;
--------------- HTMLFormJApplet.html -------------------
<applet codebase="." code="HTMLFormJApplet.class" width="350" height="350">
<param name="page_name" value="testform.html">
</applet>
--------------- testform.html --------------------------
<form method="POST" action="myservlet">
<font color="green">First Name:</font><input type="TEXT" value="firstname" value="wally"><br>
<input type="SUBMIT" value="Submit">
</form>

Similar Messages

  • Not Getting the Quuery string parameters in the submission of Html Form.

    Hi
    We are using the MVC architecture, and while submitting the form conatining some hiddenn parameters aand havin URL as abc/xyz?a=b&c=d
    I am able to retrieve the hidden parameters on form submission but am not getting query parametres.
    regards
    Amit

    hi
    Actually I am using a java script function to submit the form.
    In the servlet, we are using req.getParameterNames(); But I have debugged, and query parameters are not reaching there, it is showing
    query string = null.
    The function i m using is
    url=abc/xyz?a=b;
    function sub(url)
    parent.framename.document.form[0].action=url;
    parent.framename.document.form[0].submit();

  • Is it possible to convert PDF file into HTML

    Dear friends
    Is it possible to convert PDF file into HTML. I have few hundread PDF files i like to convert this files into HTML. I hope it can be done through Java but i don't know how to start this coding. anybody can give me a brief idea to go ahead.

    Why do you want to do this yourself? I quick search on Google showed several utilities to do this, some freeware, some commercial.

  • Is it possible to make an .exe file in Forms 6i

    Dear Sir,
    I have some doubts regarding some of the Oracle Products.
    1. Is it possible to make .exe file in Oracle Forms 6i ?
    2. In Oracle 7.3 / Forms 4.5/ Reports 2.5, it was necessary to install Oracle Enterprise at the server and install forms and reports runtime at the nodes. What is the case with Oracle 8i and Forms 6i and Reports 6i.
    Do we need to install the runtime at the nodes.
    3. If I develop a software using D2k (Forms 6i/Reports 6i) using Oracle 8i, what is required at the client's place to run it. Do they need to buy Oracle 8i as well as D2k(in full) or D2K Runtime is seperately available?
    Please reply to the above queries. Thanking you
    Sambaran Datta
    null

    - You cannot create a single exe file for Forms. You will have to install the runtime and then deploy the application fmx files.
    To deploy, you will need to install the Forms runtime on each machine which will be running forms. So if you are running client server and you have 100 client machine you would do 100 installs. Alternatively, if you are installing on the Web then you install the runtime on a server and your 100 clients only need to connect from browser.
    I'm not sure how the licencing sales are worked out - your account manager would have a better idea but you don;t have to have an 8i for every client (!) - the Forms runtime and the database are separate.
    Regards
    Grant Ronald

  • Is it possible to setup an alert before the form opens?

    Is it possible to setup an alert before the form opens? If yes how would I do that?
    I have tried to create an alert in preOpen java script but the "preOpen" option is greyed out.
    thank you

    The iPhone will set up any version of the AirPort Extreme from Generation 1 through 6.
    Once you have the AirPort setup, you might want to downloand and install AirPort Utility to be able to make any changes or adjustments to the AirPort.
    AirPort Utility on the App Store on iTunes

  • Submission failed: This form can no longer be submitted. Please contact the author.

    I created a fillable form with FomCentral, saved it as pdf. I then uploaded it back to form formCentral and then opened it and distributed it. When I try to test the workability of the form by filling it myself and click on the submit button, I get an error message; Submission failed: This form can no longer be submitted. Please contact the author.
    Note: I am using windows 8 operating system and have chrome, IE10 and firefox browsers.

    When you say that "you were not getting any responses" do you mean that people told you they were submitting but you were not getting anything in the response table?
    Once you delete the form in FormsCentral you automatically break all distributed PDF forms or distributed online fillable form link. You need to redistribute your new PDF form and resend your new online form's link.
    Gen

  • Is File handling in Java Swing possible?

    Hi I need to know whether file handling in Java Swing is possible or not?

    cents wrote:
    Thanks for ur answer.....Actually I just wanted to know whether "Reading from a file" and "Writing to a file" in Java Swing is possible or not?
    Edited by: cents on Mar 16, 2010 9:35 AMWhat did google tell you? Did you see anything interesting in the API?

  • Is it possible to place a formula into a form

    Is it possible to place a formula into a form?

    Why not? There seems to be a lot of requests/inquiries for this type of support? Not having this function is extremely limiting to us...to the point where we may have to abandon acrobat forms central all together and purchase a product which isn't limiting or misleading in their offered features.

  • Is it possible to import an Access database and forms

    Is it possible to import an Access database and forms into apex

    Yes and no.. Sorry.. The Access data tables and data can be imported into the database, through SQL Developer. The forms I don't believe will be ported over. What will be created through is a set of maintenance report and form sets for each table you convert over.
    That is a good start to converting the database over, since you will probably want to re-do your Access style vba coding to use the available templates and pl/sql code..
    Thank you,
    Tony Miller
    Webster, TX

  • Is it possible to use 32-bit firefox with 64-bit java plugin?

    Is it possible to use 32-bit firefox with 64-bit java plugin?
    I'd like to use 32-bit firefox and I already install 64-bit java plugin.
    Is that a right choice not to install 32-bit java plugin?
    Will these cause problem?
    Thanks in advance.
    Regards,
    Sean

    Nope - you need the 32bit Java to go with the 32bit Firefox if you want Java to run

  • How do I attach a JavaBean to a HTML Form submission

    I found an example in the O'Reilly JavaServer Pages book that shows you how to pass a JavaBean from a JSP to a servlet.
    <jsp:useBean id="userInfo" scope="request" class="com.ora.jsp.beans.userinfo.UserInfoBean">
    <jsp:setProperty name="userInfo" property="*" />
    </jsp:useBean>
    <jsp:forward page="/myServlet" />
    Then in the servlet, you do:
    UserInfoBean userInfo = ( UserInfoBean )request.getAttribute("userInfo");
    I want to do almost the exact same thing...but I don't want to forward the request. I want to pass the JavaBean along as part of an HTML form submission. Can anyone help me out with this? Thanks.

    Assuming that you have setup your environment correctly and you have a web application server like Tomcat running.
    Since you didn't provide the code for the bean I created my own. You can change the code any way you want.
    Say UserInfoBean is :
    package test17;
    public class UserInfoBean {
        String firstName;
        String lastName;
        public UserInfoBean() {
        public String getFirstName() {
            return firstName;
        public void setFirstName(String firstName) {
            this.firstName = firstName;
        public String getLastName() {
            return lastName;
        public void setLastName(String lastName) {
            this.lastName = lastName;
    }And say you have a JSP page like this:
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
      <head><title></title></head>
      <body>
      <jsp:useBean id="userInfo" scope="request" class="test17.UserInfoBean">
      <jsp:setProperty name="userInfo" property="*" />
      </jsp:useBean>
      <form action="index.jsp" method="POST">
          <input type="text" name="firstName" value="${userInfo.firstName}"/>
          <br/><br/>
          <input type="text" name="firstName" value="${userInfo.lastName}"/>
          <br/><br/>
          <input type="submit" name="submit" value="submit"/>
      </form>
      </body>
    </html>If you access the JSP page like this:
    http://localhost:8080/p/test17/index.jsp?firstName=George&lastName=W
    then it passes in the request parameter from the query string and populates the form.
    Once the form is populated if you submit the form , data is transmitted to the next page , and you can access it via request.getParameter.
    Is this the solution you are looking for?

  • Display alert message On successful submission of a form

    I am trying display an alert message on a portal form when a user has saved their changes. I put the following code in the "On successful submission of a form" section.
    It does the go URL correctly but it does not display the alert message.
    url2 := 'PORTAL.wwa_app_module.link?' ||
    'p_arg_names=_moduleid&p_arg_values=' || l_module_id ||
    '&p_arg_names=_show_header&p_arg_values=YES' ||
    '&p_arg_names=_school_cond&p_arg_values=%3D' ||
    '&p_arg_names=_teacher_id_cond&p_arg_values=%3D';
    go(url2);
    htp.p('<SCRIPT LANGUAGE="JavaScript1.1">');
    htp.p('alert("Transaction complete... Class/Period Attendance has been posted to database.")');
    htp.p('</SCRIPT>');
    END;

    In Forms, you have "call" and "go" interfaces. You can provide the calling page URL in "go" interface.

  • Possible to create a JAR file from within a java app?

    Is it possible to create a jar file from within a java application?
    Can it be done more elegantly than by spawning-off another
    process with the Runtime and exec() portions of the api?
    Thanks
    Scott

    Thanks! I was mislead by the API notes for java.util.jar:
    The JarOutputStream class is used to write the contents
    of a JAR file to any output stream.
    I was looking for a class or method to make jar files.
    Seems this is it ;)
    Thanks
    Scott

  • Is It Possible to store an entire  file in database using java?

    Hi All,
    I am new to Programming. please help he out Is It Possible to store an entire file in database using java? is possible, can u tell me the way to make this success? Thank you in advance.

    Thanks PhHein
    i got that application. i stored one file in db, and i displayed that in browser. thank u very much.

  • Hi, after submission of the form, can the respondents make changes to their answers and submit the form again without completing every single question?

    Hi there,
    After submission of the form, can the respondents make changes to their answers and submit the form again without completing every single question?
    Thanks for your help
    Paline

    Hi Paline,
    Unfortunately this cannot be done.However, being the author of the form you can make the required changes in the response file.
    Thanks,
    Vikrantt Singh

Maybe you are looking for

  • Boot Camp - External DVD Reader (Mac Compatible)

    To all, I am not able to get Boot Camp to load vista from the external CD-ROM since the internal one is totaly disconnected. It does nothing. It spins the CD when it restarts then continues on to loading the login screen. Bare with me - this is the f

  • Reconciliation account ready for input

    Dear All, While creating GL, if it is a recon account, then it is picked up form the Account Type (ie) either vendors/debtors/assets. What is the use of 'Reconciliation account ready for input', Will there be any other recon items other than vendors/

  • Context menu

    I just want to add my own custom context menu item and remove or hide all the default menu items, how will it be possible. please give me entire code for this requirement as early as possible. waiting for ur reply. Thanks

  • I just got a new hard drive and would like to find my "favorites" from a previous Firefox.

    I just got a new hard drive and had to re start Firefox but cannot find my Favorites. Are they stored somewhere that I can locate them?

  • ICloud isn't working on my Macbook

    I came onto my Macbook Air today and all my Movies, Tv Programmes and Music were all gone. They were all there and working fine this morning, but they are not working now. As I dont want them to clog up my storage, i didnt have them downloaded on my