• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

hidden variables in an applet

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi i am fairly new to the java seen howver i am trying to retrieve a hidden variable from a html doc through my java applet which is fired into the html doc.

i can assign an image path and the image displays in the applet no problem but when i declare it as a variable it wont let me carryan image variable across.

i have since altered it and am trying to caryy a string variable and then through a series of if statements assign the image path to the variable that has been carried over but this does obviuosly meen i have to carry each image option as a seperate variable name through the code.



however i keep getting the same error saying that they are incompatible types please help!!


public class scribble4 extends Applet implements ImageObserver
{

//declaration of variables

protected Image main;
protected Image frim;
private String rim1 = getParameter(String rim1);


public void init()
{

// get the images
main = getImage(getDocumentBase(), "r34main.jpeg");
frim = getImage(getDocumentBase(), "images/oxigin_1.jpg");
rim1 = getImage(getDocumentBase(), "images/avalini_blade.jpg");
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your problem line is probably

private String rim1 = getParameter(String rim1);

In your html doc you should have something such as this:


Then in your class you should do

The key difference is that you are using sending it a String with the value "rim1" instead of just a variable named rim1.
 
And will you succeed? Yes you will indeed! (98 and 3/4 % guaranteed) - Seuss. tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic