Solved

Getting send html form event and data sent in JTextPane

Posted on 2004-09-06
7
385 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This video teaches viewers about errors in exception handling.

789 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