Solved

Getting send html form event and data sent in JTextPane

Posted on 2004-09-06
7
403 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 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
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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 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…
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 …

717 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