Article View: es.comp.lenguajes.java
Article #28394Problemillas con Java
From: Monkiki
Date: Fri, 01 May 1998 00:00
Date: Fri, 01 May 1998 00:00
87 lines
2553 bytes
2553 bytes
Creo y compilo este programa bajo Linux:
import java.awt.*;
import java.util.*;
// Pone una ventana en el centro de la pantalla.
public class Ventana {
public Ventana() {
Frame f = new Frame("Prueba de Java");
int f_width=0, f_height=0;
// Locale.setDefault(new Locale("ES", "ES", "Traditional_WIN"));
Dialog d = new Dialog(f, "Holar");
d.add(new Label("Saluditos"));
d.pack();
d.show();
f.setLayout(new FlowLayout(FlowLayout.CENTER, 20, 20));
TextField tf = new TextField("Escribe aquí algo");
f.add(tf);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
TextField otro = new TextField(screenSize.toString());
f.add(otro);
f.pack();
//f.show(); // Como no se ponga delante del setLocation, no
funciona.
Dimension tamaño = f.getSize();
f.setLocation((screenSize.width - tamaño.width) / 2,
(screenSize.height - tamaño.height) / 2);
f.show();
}
public static void main(String args[]) {
new Ventana();
}
}
Pero no aparece nada en los TextField y a cambio me da unos mensajitos
como estos:
Warning:
Name: textfield
Class: XmTextField
Character 'i' not supported in font. Discarded.
Warning:
Name: textfield
Class: XmTextField
Character 'm' not supported in font. Discarded.
Warning:
Name: textfield
Class: XmTextField
Character 'e' not supported in font. Discarded.
(etc...)
Con el JDK-1.1.3 no me pasaba esto, pero al instalar el nuevo JDK-1.1.5
ya veis lo que pasa. ¿Alguna ayudita?
--
---------------------------------------------------------------------
* 2+1=3. 3+1=4. 4+1=4.9999 Well! let's name it Pentium!!
-------------
Funcionando bajo Red Hat Linux 5.0 (Hurricane)
E-mail: monkiki@ctv.es
Web: (en construcción)
--------------------------------------------------------------------
Technical Details
Message-ID:
<3549BDB4.54245C30@ctv.es>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f9fe1,5ada87a0c924606b,start X-Google-Attributes: gidf9fe1,public X-Google-Thread: 1116f3,5ada87a0c924606b,start X-Google-Attributes: gid1116f3,public From: Monkiki <monkiki@ctv.es> Subject: Problemillas con Java Date: 1998/05/01 Message-ID: <3549BDB4.54245C30@ctv.es> X-Deja-AN: 349573137 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Organization: Soy muy desorganizado Newsgroups: es.comp.lenguajes.java,es.comp.os.linux