> 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
[quoted text clipped - 6 lines]
> This is the applet
> Url = getParameter("Url");
It would help enormously if you adhered to the convention that variable names
begin with a lowercase letter and class names with uppercase. When I first saw
the above line I thought it was totally incorrect because you were attempting
to assign a String to a Url.
In newsgroups communication is everything, and failing to communicate
successfully means that you won't get the help you want. Making our life easier
by using the conventions is more likely to get help, rather than being ignored.
> HTTP = getParameter("HTTP");
> System.out.println(Url);
[quoted text clipped - 20 lines]
> Can anyone please tell me how to make the Url and HTTP global variables in
> the Frame.
A variable which is "global" to a class is a class variable (static) in that it
is shared amongst all instances of that class. But I don't think that's what
you want here. I think what you want is a variable which is accessible by all
methods within the class. For that you want an instance variable. These are
defined in the class, but outside of any method. They can be set within the
constructor.
You can't make a variable which is a parameter to the constructor visible to
other methods, you have to declare a variable in the scope of the class and set
it in the constructor.
e.g.
public class FinalApp {
String url;
String http;
public FinalApp(String Url,String HTTP,String title) {
...
url = Url;
http = HTTP;
...
}
public void someMethod() {
System.out.println(url);
}
...

Signature
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
Richard Perreault - 25 Mar 2006 00:04 GMT
Thank you that work perfectly.
>> 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
[quoted text clipped - 86 lines]
> }
> ...