Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Getting send html form event and data sent in JTextPane

Posted on 2004-09-06
7
Medium Priority
?
406 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

719 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