Subj : Re: Calling already-constructed Java Classes in Rhino? To : Mathew McBride From : nboyd@atg.com (Norris Boyd) Date : Mon Apr 14 2003 08:03 pm Ah, so you want to expose a given Java object to JavaScript scripts? Take a look at http://www.mozilla.org/rhino/tutorial.html#AddJava --N Mathew McBride wrote: > Not what I had in mind. > > This is what I mean: > > Java code: > JButton hit = new JButton("hit me"); > > then: > > JS code: > hit.setText("don't hit me"); > > Norris Boyd wrote: > >> How about >> >> var hit = new Packages.javax.swing.JButton("hit me") >> hit.setText("don't hit me") >> >> --N >> >> Mathew McBride wrote: >> >>> Hi, >>> >>> Is there any way I can call a Java class constructed in Java already >>> e.g: >>> >>> JButton hit = new JButton("hit me"); >>> >>> Then use this JavaScript code: >>> hit.setText("don't hit me"); >>> >>> Is there any way to do this? >>> >>> Thanks in advance >>> >>> >>> >> >> > > > .