Solved

Getting send html form event and data sent in JTextPane

Posted on 2004-09-06
7
396 Views
Last Modified: 2008-01-09
I already know how to catch clicks on url's that are displayed in JTextPane with addHyperlinkListener(something) but now, I would like to treat forms also (standard html forms) but I can't find any way to do it.

How can I know user clicked "send" button? I can't find any event listener for this in JTextPane, also  How can I get all the data user wants to send?

I've seen javax.swing.text.html.FormView _absolutely_ no idea how to use this one + i'm not sure if it's really what I need because I need to display more data than just forms.

thank you for answers!
0
Comment
Question by:nuocnam
  • 3
  • 2
  • 2
7 Comments
 
LVL 92

Expert Comment

by:objects
ID: 11993469
i think it (FormView) handles posting the form for you.
 
0
 

Author Comment

by:nuocnam
ID: 11993508
actually, i don't want to post it to net, but i want to parse it in my java program

if you think i should use FormView, could you please explain me how to pass the form in html format to it (it asks for "Element" type)
0
 
LVL 18

Accepted Solution

by:
armoghan earned 125 total points
ID: 11993527
Please see the attached link
http://www.javalobby.org/kb/click.jspa?categoryID=41&entryID=243&searchID=6062

That is how I once attached the action listeners to the HTML components on a web Page, e.g. Button,
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 92

Expert Comment

by:objects
ID: 11993538
> if you think i should use FormView

I'd say its already being used.
0
 
LVL 92

Expert Comment

by:objects
ID: 11993544
> could you please explain me how to pass the form in html format to it (it asks for "Element" type)

Thats the job of the HTMLEditorKit I think. And as I said above is already being done (otherwise how would your form currently be displayed).
You may need to replace that implementation with one of your own
0
 
LVL 18

Expert Comment

by:armoghan
ID: 11993558
On clicking the submit button, you can get the document of FormView and find out the values on each child nodes
0
 

Author Comment

by:nuocnam
ID: 11993646
that was exactly what I was looking for. Thank you for your help!
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question