Solved

Getting send html form event and data sent in JTextPane

Posted on 2004-09-06
7
358 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now