aspose file tools
The moose likes Applets and the fly likes Liveconnect- background color Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Applets
Reply Bookmark "Liveconnect- background color" Watch "Liveconnect- background color" New topic
Author

Liveconnect- background color

Venkata Kiran
Ranch Hand

Joined: Sep 06, 2005
Posts: 30
Hai All,
can v change the backgrouund color of an applet based on user selection using Javascript.
Thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35232
    
    7
Yes, using LiveConnect that's possible. What do you have so far?


Android appsImageJ pluginsJava web charts
Venkata Kiran
Ranch Hand

Joined: Sep 06, 2005
Posts: 30
I must accept a color from a textbox and on button click must set new color as the background color. I tried onKlick="document.AppletName.setBackgroundColordocument.form1.textBox.value)
I am getting an error : Object does not support this property.
i had just started working with LiveConnect ,
r there any good links for this.
Thank You.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35232
    
    7
onKlick="document.AppletName.setBackgroundColordocument.form1.textBox.value)

I assume that's just a typo, and you really have (i.e., there is an opening parenthesis):
document.AppletName.setBackgroundColor(document.form1.textBox.value)

I'm not sure if the error message is about the HTML form or the applet. Do an "alert(document.form1.textBox.value)" before you call the applet method, just to see if the correct value is transmitted.

Also, the setBackgroundColor method must be declared public for this to work.

The Applet FAQ -linked in my signature- has a section on LiveConnect which will get you started.
[ January 02, 2006: Message edited by: Ulf Dittmer ]
Venkata Kiran
Ranch Hand

Joined: Sep 06, 2005
Posts: 30
The setBackground color is declared as public and the alert statements are displaying the correct values entered in textboxes.

but still i am getting an error java.lang.Exception:setBackgroundColor(0): no such method exists;
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35232
    
    7
What type has the parameter of setBackgroundColor? I'm not sure how well passing integers works - try declaring it as a String, and converting that to int in the Java code.
Venkata Kiran
Ranch Hand

Joined: Sep 06, 2005
Posts: 30
ok got an excellent link which almost suits my requirement at
www.experts-exchange.com
Thnaks You for the Help.

[ link edited by UD to keep the formatting readable ]
[ January 03, 2006: Message edited by: Ulf Dittmer ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Liveconnect- background color
 
Similar Threads
Passed SCBCD 5.0
WA #1.....word association
Problem with Devakas Final Exam Q on Static Thread methods
Is Ruby easier to learn than Java, since there appears to be less code to write?
scea - 1 experiences