Results 1 to 3 of 3
- 03-13-2011, 04:49 AM #1
Member
- Join Date
- Mar 2011
- Posts
- 4
- Rep Power
- 0
Pass variable from program to web page
Hi,
ive currently got a java swing program that has some text fields for a user to enter text into and then there is a button which when clicked opens up a web page which is displayed within a jeditorpane on a jframe (not the most elegant approach i know but it suits my purposes well enough).
im trying to find out whether its possible to pass what has been entered by a user in the text fields to forms on the web page that opens. ive had a search and cant really seem to find a huge amount about this specific problem. id really appreciate some advice on whether it is possible and some help or a point in the direction to which i should be looking.
thanks in advance,
stephen
- 03-13-2011, 09:41 AM #2
Member
- Join Date
- Mar 2011
- Posts
- 26
- Rep Power
- 0
I would try to google "Mechanize for java"...
Disclaimer: This idea has derived from knowledge of other languages. Mechanize or any equivalent may not be the best tool for use in java but it may be a good starting point for your search.
Cheers.
-
The web page should use an applet which, when requested, gets the information required from the java program and passes it to a variable in your HTML/JavaScript.
HTML code:Java Code:import java.applet.*; import java.awt.*; public class appletParameter extends Applet { private String strDefault = "Hello! Java Applet."; public void paint(Graphics g) { String strParameter = this.getParameter("Message"); if (strParameter == null) strParameter = strDefault; g.drawString(strParameter, 50, 25); } }
Java Code:<APPLET code="appletParameter.class" width="800" height="100"> <PARAM name="message" value="Welcome in Passing parameter in java applet example."> </APPLET>
Similar Threads
-
pass a variable from one object to another
By kev670 in forum New To JavaReplies: 3Last Post: 11-25-2010, 01:20 AM -
How can I Pass Variable from JApplet to PHP?
By fantasyme in forum JDBCReplies: 2Last Post: 04-18-2010, 04:48 AM -
How to pass a variable to another frame.
By DJCali in forum New To JavaReplies: 10Last Post: 10-14-2009, 03:57 AM -
How pass variable from jsp to servelet
By shiva in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 04-22-2009, 01:55 PM -
How to pass an html variable as an applet value
By fred in forum Java AppletsReplies: 1Last Post: 08-06-2007, 03:28 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks