For Programmers: Free Programming Magazines  


Home > Archive > Java Help > March 2006 > Have a constructer with the paramters sent through an applet store them as global var









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Have a constructer with the paramters sent through an applet store them as global var
Richard Perreault

2006-03-23, 10:04 pm

I have a program that uses an applet to transfer parameters from an Html
page. And transfer them to a constructor. This works very well, I did add
println commands to make sure it functions properly. When I open the applet
which loads a frame. I see the variables even before the frame is loaded. My
problem is that these variables are not global. If I do not create the
variable at the beginning of the Frame I get an error as symbol not found.
Here is some snippets of my program.

This is the applet
Url = getParameter("Url");
HTTP = getParameter("HTTP");
System.out.println(Url);
System.out.println(HTTP);

//try {
//finalapp being loaded
//This is how you pass parameters from an applet to a frame!
window = new finalapp (Url,HTTP,"Pop-Up Window");
//catch (IOException e) {
//System.out.println("Error: "+ e.getMessage());
//}

And this is the constructor of the Frame

// Constructor
public finalapp(String Url,String HTTP,String title)
{
super(title);
System.out.println(Url+" "+HTTP);
// Read the Questions file;
// Frame Initialization

Can anyone please tell me how to make the Url and HTTP global variables in
the Frame.



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com