diff options
Diffstat (limited to 'files/es/archive/web/liveconnect')
-rw-r--r-- | files/es/archive/web/liveconnect/index.html | 23 | ||||
-rw-r--r-- | files/es/archive/web/liveconnect/java/index.html | 15 | ||||
-rw-r--r-- | files/es/archive/web/liveconnect/javaarray/index.html | 65 | ||||
-rw-r--r-- | files/es/archive/web/liveconnect/javaclass/index.html | 64 | ||||
-rw-r--r-- | files/es/archive/web/liveconnect/javaobject/index.html | 61 | ||||
-rw-r--r-- | files/es/archive/web/liveconnect/javapackage/index.html | 39 | ||||
-rw-r--r-- | files/es/archive/web/liveconnect/netscape/index.html | 23 | ||||
-rw-r--r-- | files/es/archive/web/liveconnect/packages/index.html | 44 | ||||
-rw-r--r-- | files/es/archive/web/liveconnect/sun/index.html | 17 |
9 files changed, 0 insertions, 351 deletions
diff --git a/files/es/archive/web/liveconnect/index.html b/files/es/archive/web/liveconnect/index.html deleted file mode 100644 index 328b6d2678..0000000000 --- a/files/es/archive/web/liveconnect/index.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: LiveConnect -slug: Archive/Web/LiveConnect -tags: - - AJAX - - Guía_de_JavaScript_1.5 - - JavaScript - - Referencia_de_JavaScript_1.5 - - Todas_las_Categorías -translation_of: Archive/Web/LiveConnect/LiveConnect_Reference ---- -<p> -</p><p>This section documents the Java classes used for <a href="es/LiveConnect">LiveConnect</a>, along with their constructors and methods. These classes allow a Java object to access JavaScript code. -</p><p><a href="es/Referencia_de_JavaScript_1.5/LiveConnect/JSException">JSException</a> -</p> -<dl><dd> The public class <code>JSException</code> extends <code>RuntimeException</code>, and is thrown when JavaScript returns an error. -</dd></dl> -<p><a href="es/Referencia_de_JavaScript_1.5/LiveConnect/JSObject">JSObject</a> -</p> -<dl><dd> The public class <code>JSObject</code> extends <code>Object</code>. JavaScript objects are wrapped in an instance of the class <code>JSObject</code> and passed to Java, allowing Java to manipulate JavaScript objects. -</dd></dl> -<div class="noinclude"> -</div> diff --git a/files/es/archive/web/liveconnect/java/index.html b/files/es/archive/web/liveconnect/java/index.html deleted file mode 100644 index 46df56223d..0000000000 --- a/files/es/archive/web/liveconnect/java/index.html +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: java -slug: Archive/Web/LiveConnect/java -translation_of: Archive/Web/LiveConnect_Reference/java ---- -<p>Resumen</p> -<p><strong>Objeto Global</strong></p> -<p>Un objeto de alto nivel utilizado para acceder a cualquier clase Java del paquete <code>java.*</code>.</p> -<h3 id="Created_by" name="Created_by">Creado por</h3> -<p>El objeto <code>java</code> es un objeto Javascript predefinido de alto nivel. Puedes acceder a él de forma automática sin utilizar un constructor o sin llamar a un método.</p> -<h3 id="Descripci.C3.B3n" name="Descripci.C3.B3n">Descripción</h3> -<p>El objeto <code>java</code> es un buen sinónimo de la propiedad <code>Packages.java</code>.</p> -<h3 id="Ver_tambi.C3.A9n" name="Ver_tambi.C3.A9n">Ver también</h3> -<p><a href="/es/Referencia_de_JavaScript_1.5/Objetos_globales#Paquetes" title="es/Referencia_de_JavaScript_1.5/Objetos_globales#Paquetes">Paquetes</a>, <a href="/es/Referencia_de_JavaScript_1.5/Objetos_globales#Paquetes:java" title="es/Referencia_de_JavaScript_1.5/Objetos_globales#Paquetes:java">Packages.java</a></p> -<p></p> diff --git a/files/es/archive/web/liveconnect/javaarray/index.html b/files/es/archive/web/liveconnect/javaarray/index.html deleted file mode 100644 index 1ec785bfc5..0000000000 --- a/files/es/archive/web/liveconnect/javaarray/index.html +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: JavaArray -slug: Archive/Web/LiveConnect/JavaArray -translation_of: Archive/Web/LiveConnect_Reference/JavaArray ---- -<p> -</p> -<h3 id="Summary" name="Summary"> Summary </h3> -<p><b>Core Object</b> -</p><p>A wrapped Java array accessed from within JavaScript code is a member of the type <code>JavaArray</code>. -</p> -<h3 id="Created_by" name="Created_by"> Created by </h3> -<p>Any Java method which returns an array. In addition, you can create a <code>JavaArray</code> with an arbitrary data type using the <code>newInstance</code> method of the <code>Array</code> class: -</p> -<pre class="eval">public static Object newInstance(Class componentType, - int length) - throws NegativeArraySizeException -</pre> -<h3 id="Description" name="Description"> Description </h3> -<p>The <code>JavaArray</code> object is an instance of a Java array that is created in or passed to JavaScript. <code>JavaArray</code> is a wrapper for the instance; all references to the array instance are made through the <code>JavaArray</code>. -</p><p>In JavaScript 1.4 and later, the <code>componentType</code> parameter is either a <code>JavaClass</code> object representing the type of the array or class object, such as one returned by <code>java.lang.Class.forName</code>. In JavaScript 1.3 and earlier, <code>componentType</code> must be a class object. -</p><p>Use zero-based indexes to access the elements in a <code>JavaArray</code> object, just as you do to access elements in an array in Java. For example: -</p> -<pre class="eval">var javaString = new java.lang.String("Hello world!"); -var byteArray = javaString.getBytes(); -byteArray[0] // returns 72 -byteArray[1] // returns 101 -</pre> -<p>Any Java data brought into JavaScript is converted to JavaScript data types. When the <code>JavaArray</code> is passed back to Java, the array is unwrapped and can be used by Java code. See the <a href="es/Core_JavaScript_1.5_Guide">Core JavaScript 1.5 Guide</a> for more information about data type conversions. -</p><p>In JavaScript 1.4 and later, the methods of <code>java.lang.Object</code> are inherited by <code>JavaArray</code>. -</p> -<h3 id="Backward_compatibility" name="Backward_compatibility"> Backward compatibility </h3> -<h4 id="JavaScript_1.3_and_earlier" name="JavaScript_1.3_and_earlier"> JavaScript 1.3 and earlier </h4> -<p>The methods of <code>java.lang.Object</code> are not inherited by <code>JavaArray</code>. In addition, the <code>toString</code> method is inherited from the <code>Object</code> object and returns the following value: -</p> -<pre class="eval">[object JavaArray] -</pre> -<p>You must specify a class object, such as one returned by <code>java.lang.Object.forName</code>, for the <code>componentType</code> parameter of <code>newInstance</code> when you use this method to create an array. You cannot use a <code>JavaClass</code> object for the <code>componentType</code> parameter. -</p> -<h3 id="Properties" name="Properties"> Properties </h3> -<p><a href="es/Core_JavaScript_1.5_Reference/Global_Objects/JavaArray/length">length</a>: The number of elements in the Java array represented by <code>JavaArray</code>. -</p> -<h3 id="Methods" name="Methods"> Methods </h3> -<p><a href="es/Core_JavaScript_1.5_Reference/Global_Objects/JavaArray/toString">toString</a>: In JavaScript 1.4, this method is overridden by the inherited method <code>java.lang.Object.toString</code>. in JavaScript 1.3 and earlier, this method returns a string identifying the object as a <code>JavaArray</code>. -</p><p>In JavaScript 1.4 and later, <code>JavaArray</code> also inherits methods from the Java array superclass, <code>java.lang.Object</code>. -</p> -<h3 id="Examples" name="Examples"> Examples </h3> -<h4 id="Example:_Instantiating_a_JavaArray_in_JavaScript" name="Example:_Instantiating_a_JavaArray_in_JavaScript"> Example: Instantiating a <code>JavaArray</code> in JavaScript </h4> -<p>In this example, the <code>JavaArray</code> <code>byteArray</code> is created by the <code>java.lang.String.getBytes</code> method, which returns an array. -</p> -<pre class="eval">var javaString = new java.lang.String("Hello world!"); -var byteArray = javaString.getBytes(); -</pre> -<h4 id="Example:_Instantiating_a_JavaArray_in_JavaScript_with_the_newInstance_method" name="Example:_Instantiating_a_JavaArray_in_JavaScript_with_the_newInstance_method"> Example: Instantiating a <code>JavaArray</code> in JavaScript with the <code>newInstance</code> method </h4> -<p>In JavaScript 1.4, you can use a <code>JavaClass</code> object as the argument for the <code>newInstance</code> method which creates the array, as shown in the following code: -</p> -<pre class="eval">var dogs = java.lang.reflect.Array.newInstance(java.lang.String, 5); -</pre> -<p>In JavaScript 1.1, use a class object returned by <code>java.lang.Class.forName</code> as the argument for the newInstance method, as shown in the following code: -</p> -<pre class="eval">var dataType = java.lang.Class.forName("java.lang.String"); -var dogs = java.lang.reflect.Array.newInstance(dataType, 5); -</pre> -<div class="noinclude"> -</div> diff --git a/files/es/archive/web/liveconnect/javaclass/index.html b/files/es/archive/web/liveconnect/javaclass/index.html deleted file mode 100644 index 75ebf01604..0000000000 --- a/files/es/archive/web/liveconnect/javaclass/index.html +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: JavaClass -slug: Archive/Web/LiveConnect/JavaClass -tags: - - páginas_a_traducir -translation_of: Archive/Web/LiveConnect_Reference/JavaClass ---- -<h3 id="Resumen" name="Resumen">Resumen</h3> - -<p><strong>Objeto Global</strong></p> - -<p>Una referencia JavaScript de una clase Java.</p> - -<h3 id="Created_by" name="Created_by">Creado por</h3> - -<p>Una referencia del nombre de clase utilizada en el objeto <code>Packages</code>:</p> - -<pre class="eval">Packages.<em>JavaClass</em> -</pre> - -<p><em>JavaClass</em> es el nombre completo de la clase Java. Los objetos LiveConnect <code>java</code>, <code>sun</code>, y <code>netscape</code> ofrecen accesos directos para los paquetes Java más utilizados, además de crear objetos <code>JavaClass</code>.</p> - -<h3 id="Descripci.C3.B3n" name="Descripci.C3.B3n">Descripción</h3> - -<p>Un objeto <code>JavaClass</code> es una referencia a una de las clases de un paquete Java, como <code>netscape.javascript.JSObject</code>. Un objeto <code>JavaPackage</code> es una referencia a un paquete Java, como <code>netscape.javascript</code>. En JavaScript, las jerarquías <code>JavaPackage</code> y <code>JavaClass</code> reflejan el paquete Java y la jeraquía de clases.</p> - -<p>Puedes pasar un objeto <code>JavaClass</code> a un método Java que requiera un argumento de tipo <code>java.lang.Class</code>.</p> - -<h3 id="Backward_compatibility" name="Backward_compatibility">Compatibilidad hacia atrás</h3> - -<h4 id="JavaScript_1.3_y_earlier" name="JavaScript_1.3_y_earlier">JavaScript 1.3 y anteriores</h4> - -<p>Debes crear un contenedor y meter dentro una instancia de <code>java.lang.Class</code> antes de pasarlo como parámetro a un método Java -- los objetos <code>JavaClass</code> no se convierten de forma automática a instancias de <code>java.lang.Class</code>.</p> - -<h3 id="Propiedades" name="Propiedades">Propiedades</h3> - -<p>Las propiedades de un objeto <code>JavaClass</code> son los campos estáticos de la clase Java.</p> - -<h3 id="M.C3.A9todos" name="M.C3.A9todos">Métodos</h3> - -<p>Los métodos de un objeto <code>JavaClass</code> son los métodos estáticos de la clase Java.</p> - -<h3 id="Ejemplos" name="Ejemplos">Ejemplos</h3> - -<h4 id="Ejemplos:_Utilizando_JavaClass" name="Ejemplos:_Utilizando_JavaClass">Ejemplos: Utilizando <code>JavaClass</code></h4> - -<p>En el siguiente ejemplo, <code>x</code> es un objeto JavaClass que hace referencia a java.awt.Font. Debido a que BOLD es un campo estático de la clase Font, también es una propiedad del objeto JavaClass.</p> - -<pre class="eval">x = java.awt.Font; -myFont = x("helv", x.BOLD, 10); // crea un objeto Font -</pre> - -<p>El ejemplo anterior omite <code>Packages</code> y utiliza el sinónimo <code>java</code> debido a que la clase <code>Font</code> está en el paquete <code>java</code>.</p> - -<h4 id="Ejemplos_2" name="Ejemplos_2">Ejemplos</h4> - -<p>En el siguiente ejemplo, el objeto <code>java.lang.String </code>de <code>JavaClass</code> se pasa como un argumento al método <code>newInstance</code> creando un array:</p> - -<pre class="eval">var cars = java.lang.reflect.Array.newInstance(java.lang.String, 15); -</pre> - -<h3 id="Ver_tambi.C3.A9n" name="Ver_tambi.C3.A9n">Ver también</h3> - -<p><a href="/es/Referencia_de_JavaScript_1.5/Objetos_globales#JavaArray" title="es/Referencia_de_JavaScript_1.5/Objetos_globales#JavaArray">JavaArray</a>, <a href="/es/Referencia_de_JavaScript_1.5/Objetos_globales#JavaObject" title="es/Referencia_de_JavaScript_1.5/Objetos_globales#JavaObject">Objeto Java</a>, <a href="/es/Referencia_de_JavaScript_1.5/Objetos_globales#JavaPackage" title="es/Referencia_de_JavaScript_1.5/Objetos_globales#JavaPackage">Empaquetado Java</a>, <a href="/es/Referencia_de_JavaScript_1.5/Objetos_globales#Packages" title="es/Referencia_de_JavaScript_1.5/Objetos_globales#Packages">Paquetes</a></p> diff --git a/files/es/archive/web/liveconnect/javaobject/index.html b/files/es/archive/web/liveconnect/javaobject/index.html deleted file mode 100644 index 7248cef567..0000000000 --- a/files/es/archive/web/liveconnect/javaobject/index.html +++ /dev/null @@ -1,61 +0,0 @@ ---- -title: JavaObject -slug: Archive/Web/LiveConnect/JavaObject -translation_of: Archive/Web/LiveConnect_Reference/JavaObject ---- -<p> -</p> -<h3 id="Summary" name="Summary"> Summary </h3> -<p><b>Core Object</b> -</p><p>The type of a wrapped Java object accessed from within JavaScript code. -</p> -<h3 id="Created_by" name="Created_by"> Created by </h3> -<p>Any Java method which returns an object type. In addition, you can explicitly construct a <code>JavaObject</code> using the object's Java constructor with the <code>Packages</code> keyword: -</p> -<pre class="eval">new Packages.<i>JavaClass</i>(<i>parameterList</i>) -</pre> -<p><i>JavaClass</i> is the fully-specified name of the object's Java class. -</p> -<h3 id="Parameters" name="Parameters"> Parameters </h3> -<dl><dt> <code>parameterList</code> </dt><dd> An optional list of parameters, specified by the constructor of the Java class. -</dd></dl> -<h3 id="Description" name="Description"> Description </h3> -<p>The <code>JavaObject</code> object is an instance of a Java class that is created in or passed to JavaScript. <code>JavaObject</code> is a wrapper for the instance; all references to the class instance are made through the <code>JavaObject</code>. -</p><p>Any Java data brought into JavaScript is converted to JavaScript data types. When the <code>JavaObject</code> is passed back to Java, it is unwrapped and can be used by Java code. See the <a href="es/Core_JavaScript_1.5_Guide">Core JavaScript 1.5 Guide</a> for more information about data type conversions. -</p> -<h3 id="Properties" name="Properties"> Properties </h3> -<p>Inherits public data members from the Java class of which it is an instance as properties. It also inherits public data members from any superclass as properties. -</p> -<h3 id="Methods" name="Methods"> Methods </h3> -<p>Inherits public methods from the Java class of which it is an instance. The <code>JavaObject</code> also inherits methods from <code>java.lang.Object</code> and any other superclass. -</p> -<h3 id="Examples" name="Examples"> Examples </h3> -<h4 id="Example:_Instantiating_a_Java_Object_in_JavaScript" name="Example:_Instantiating_a_Java_Object_in_JavaScript"> Example: Instantiating a Java Object in JavaScript </h4> -<p>The following code creates the <code>JavaObject</code> <code>theString</code>, which is an instance of the class <code>java.lang.String</code>: -</p> -<pre class="eval">var theString = new Packages.java.lang.String("Hello, world"); -</pre> -<p>Because the <code>String</code> class is in the <code>java</code> package, you can also use the java synonym and omit the <code>Packages</code> keyword when you instantiate the class: -</p> -<pre class="eval">var theString = new java.lang.String("Hello, world"); -</pre> -<h4 id="Example:_Accessing_methods_of_a_Java_object" name="Example:_Accessing_methods_of_a_Java_object"> Example: Accessing methods of a Java object </h4> -<p>Because the <code>JavaObject</code> <code>theString</code> is an instance of <code>java.lang.String</code>, it inherits all the public methods of <code>java.lang.String</code>. The following example uses the <code>startsWith</code> method to check whether <code>theString</code> begins with "Hello". -</p> -<pre class="eval">var theString = new java.lang.String("Hello, world"); -theString.startsWith("Hello"); // returns true -</pre> -<h4 id="Example:_Accessing_inherited_methods" name="Example:_Accessing_inherited_methods"> Example: Accessing inherited methods </h4> -<p>Because <code>getClass</code> is a method of <code>Object</code>, and <code>java.lang.String</code> extends <code>Object</code>, the <code>String</code> class inherits the <code>getClass</code> method. Consequently, <code>getClass</code> is also a method of the <code>JavaObject</code> which instantiates <code>String</code> in JavaScript. -</p> -<pre class="eval">var theString = new java.lang.String("Hello, world"); -theString.getClass(); // returns java.lang.String -</pre> -<h3 id="See_also" name="See_also"> See also </h3> -<p><a href="es/Core_JavaScript_1.5_Reference/Global_Objects/JavaArray">JavaArray</a>, -<a href="es/Core_JavaScript_1.5_Reference/Global_Objects/JavaClass">JavaClass</a>, -<a href="es/Core_JavaScript_1.5_Reference/Global_Objects/JavaPackage">JavaPackage</a>, -<a href="es/Core_JavaScript_1.5_Reference/Global_Objects/Packages">Packages</a> -</p> -<div class="noinclude"> -</div> diff --git a/files/es/archive/web/liveconnect/javapackage/index.html b/files/es/archive/web/liveconnect/javapackage/index.html deleted file mode 100644 index 091300cd5e..0000000000 --- a/files/es/archive/web/liveconnect/javapackage/index.html +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: JavaPackage -slug: Archive/Web/LiveConnect/JavaPackage -translation_of: Archive/Web/LiveConnect_Reference/JavaPackage ---- -<p> -</p> -<h3 id="Summary" name="Summary"> Summary </h3> -<p><b>Core Object</b> -</p><p>A JavaScript reference to a Java package. -</p> -<h3 id="Created_by" name="Created_by"> Created by </h3> -<p>A reference to the package name used with the <code>Packages</code> keyword: -</p> -<pre class="eval">Packages.<i>JavaPackage</i> -</pre> -<p><i>JavaPackage</i> is the name of the object's Java package. If the package is in the <code>java</code>, <code>netscape</code>, or <code>sun</code> packages, the <code>Packages</code> keyword is optional. -</p> -<h3 id="Description" name="Description"> Description </h3> -<p>In Java, a package is a collection of Java classes or other Java packages. For example, the <code>netscape</code> package contains the package <code>netscape.javascript</code>; the <code>netscape.javascript</code> package contains the classes <code>JSObject</code> and <code>JSException</code>. -</p><p>In JavaScript, a <code>JavaPackage</code> is a reference to a Java package. For example, a reference to <code>netscape</code> is a <code>JavaPackage</code>. <code>netscape.javascript</code> is both a <code>JavaPackage</code> and a property of the <code>netscape</code> JavaPackage. -</p><p>A <code>JavaClass</code> object is a reference to one of the classes in a package, such as <code>netscape.javascript.JSObject</code>. The <code>JavaPackage</code> and <code>JavaClass</code> hierarchy reflect the Java package and class hierarchy. -</p><p>Although the packages and classes contained in a <code>JavaPackage</code> are its properties, you cannot use a <code>for...in</code> statement to enumerate them as you can enumerate the properties of other objects. </p> -<h3 id="Properties" name="Properties"> Properties </h3> -<p>The properties of a <code>JavaPackage</code> are the <code>JavaClass</code> objects and any other <code>JavaPackage</code> objects it contains. -</p> -<h3 id="Examples" name="Examples"> Examples </h3> -<p>Suppose the Redwood corporation uses the Java <code>redwood</code> package to contain various Java classes that it implements. The following code creates the <code>JavaPackage</code> red: -</p> -<pre class="eval">var red = Packages.redwood; -</pre> -<h3 id="See_also" name="See_also"> See also </h3> -<p><a href="es/Core_JavaScript_1.5_Reference/Global_Objects/JavaArray">JavaArray</a>, -<a href="es/Core_JavaScript_1.5_Reference/Global_Objects/JavaClass">JavaClass</a>, -<a href="es/Core_JavaScript_1.5_Reference/Global_Objects/JavaObject">JavaObject</a>, -<a href="es/Core_JavaScript_1.5_Reference/Global_Objects/Packages">Packages</a> -</p> -<div class="noinclude"> -</div> diff --git a/files/es/archive/web/liveconnect/netscape/index.html b/files/es/archive/web/liveconnect/netscape/index.html deleted file mode 100644 index 85d8eabb95..0000000000 --- a/files/es/archive/web/liveconnect/netscape/index.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: netscape -slug: Archive/Web/LiveConnect/netscape -translation_of: Archive/Web/LiveConnect_Reference/netscape ---- -<p> -</p> -<h3 id="Summary" name="Summary"> Summary </h3> -<p><b>Core Object</b> -</p><p>A top-level object used to access any Java class in the package <code>netscape.*</code>. -</p> -<h3 id="Created_by" name="Created_by"> Created by </h3> -<p>The <code>netscape</code> object is a top-level, predefined JavaScript object. You can automatically access it without using a constructor or calling a method. -</p> -<h3 id="Description" name="Description"> Description </h3> -<p>The <code>netscape</code> object is a convenient synonym for the property <code>Packages.netscape</code>. -</p> -<h3 id="See_Also" name="See_Also"> See Also </h3> -<p><a href="es/Core_JavaScript_1.5_Reference/Global_Objects/Packages">Packages</a>, -<a href="es/Core_JavaScript_1.5_Reference/Global_Objects/Packages/netscape">Packages.netscape</a> -</p> -<div class="noinclude"> -</div> diff --git a/files/es/archive/web/liveconnect/packages/index.html b/files/es/archive/web/liveconnect/packages/index.html deleted file mode 100644 index c66265507d..0000000000 --- a/files/es/archive/web/liveconnect/packages/index.html +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: Packages -slug: Archive/Web/LiveConnect/Packages -translation_of: Archive/Web/LiveConnect_Reference/Packages ---- -<p> -</p> -<h3 id="Summary" name="Summary"> Summary </h3> -<p><b>Core Object</b> -</p><p>A top-level object used to access Java classes from within JavaScript code. -</p> -<h3 id="Created_by" name="Created_by"> Created by </h3> -<p>The <code>Packages</code> object is a top-level, predefined JavaScript object. You can automatically access it without using a constructor or calling a method. -</p> -<h3 id="Description" name="Description"> Description </h3> -<p>The <code>Packages</code> object lets you access the public methods and fields of an arbitrary Java class from within JavaScript. The <code>java</code>, <code>netscape</code>, and <code>sun</code> properties represent the packages <code>java.*</code>, <code>netscape.*</code>, and <code>sun.*</code> respectively. Use standard Java dot notation to access the classes, methods, and fields in these packages. For example, you can access a constructor of the <code>Frame</code> class as follows: -</p> -<pre class="eval">var theFrame = new Packages.java.awt.Frame(); -</pre> -<p>For convenience, JavaScript provides the top-level <code>netscape</code>, <code>sun</code>, and <code>java</code> objects that are synonyms for the Packages properties with the same names. Consequently, you can access Java classes in these packages without the Packages keyword, as follows: -</p> -<pre class="eval">var theFrame = new java.awt.Frame(); -</pre> -<p>The <code>className</code> property represents the fully qualified path name of any other Java class that is available to JavaScript. You must use the <code>Packages</code> object to access classes outside the <code>netscape</code>, <code>sun</code>, and <code>java</code> packages. -</p> -<h3 id="Properties" name="Properties"> Properties </h3> -<p><a href="es/Core_JavaScript_1.5_Reference/Global_Objects/Packages/className">className</a>: The fully qualified name of a Java class in a package other than netscape, java, or sun that is available to JavaScript. </p><p><a href="es/Core_JavaScript_1.5_Reference/Global_Objects/Packages/java">java</a>: Any class in the Java package java.*. </p><p><a href="es/Core_JavaScript_1.5_Reference/Global_Objects/Packages/netscape">netscape</a>: Any class in the Java package netscape.*. </p><p><a href="es/Core_JavaScript_1.5_Reference/Global_Objects/Packages/sun">sun</a>: Any class in the Java package sun.*. -</p> -<h3 id="Examples" name="Examples"> Examples </h3> -<h4 id="Example:_JavaScript_function_to_create_a_Java_dialog_box" name="Example:_JavaScript_function_to_create_a_Java_dialog_box"> Example: JavaScript function to create a Java dialog box </h4> -<p>The following JavaScript function creates a Java dialog box: -</p> -<pre class="eval">function createWindow() { - var theOwner = new Packages.java.awt.Frame(); - var theWindow = new Packages.java.awt.Dialog(theOwner); - theWindow.setSize(350, 200); - theWindow.setTitle("Hello, World"); - theWindow.setVisible(true); -} -</pre> -<p>In the previous example, the function instantiates <code>theWindow</code> as a new <code>Packages</code> object. The <code>setSize</code>, <code>setTitle</code>, and <code>setVisible</code> methods are all available to JavaScript as public methods of <code>java.awt.Dialog</code>. -</p> -<div class="noinclude"> -</div> diff --git a/files/es/archive/web/liveconnect/sun/index.html b/files/es/archive/web/liveconnect/sun/index.html deleted file mode 100644 index 2ded558161..0000000000 --- a/files/es/archive/web/liveconnect/sun/index.html +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: sun -slug: Archive/Web/LiveConnect/sun -translation_of: Archive/Web/LiveConnect_Reference/sun ---- -<p> </p> -<h3 id="Summary" name="Summary">Sumario</h3> -<p><strong>Objeto Core</strong></p> -<p>Objeto de nivel superior usado para acceder a cualquier clase Java en el paquete <code>sun.*</code>.</p> -<h3 id="Created_by" name="Created_by">Creado por</h3> -<p>El objeto <code>sun</code> es un objeto Javascript predefinido de nivel superior. Puede acceder a él automáticamente sin necesidad de utilizar un constructor o llamar a un método.</p> -<h3 id="Description" name="Description">Descripción</h3> -<p>El objeto <code>sun</code> es un sinónimo de conveniencia de la propiedad <code>Packages.sun</code>.</p> -<h3 id="See_also" name="See_also">Ver también</h3> -<p><a href="/es/Core_JavaScript_1.5_Reference/Global_Objects/Packages" title="es/Core_JavaScript_1.5_Reference/Global_Objects/Packages">Packages</a>, <a href="/es/Core_JavaScript_1.5_Reference/Global_Objects/Packages/sun" title="es/Core_JavaScript_1.5_Reference/Global_Objects/Packages/sun">Packages.sun</a></p> - -<p></p> |