🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.lenguajes.java
Article #29462

TextField - TextArea

#29462
From: Javier Z�rate Alonso
Date: Sat, 06 Dec 1997 00:00
109 lines
2767 bytes
Hola!!!

Me gustaria consultaros una duda. Estoy realizando un formulario en un
applet que viene definido mas o menos por el siguiente codigo:

import java.applet.Applet;
import java.awt.*;

public class MisPaneles extends Applet{
	String [][]nombres=new String[4][6];
	Image [][]imagenes=new Image[2][3];
	int fil,fotosel,antiguasel;

	Panel p;

	Label lbltunombre;
	Label lbltumail;
	Label lblsunombre;
	Label lblsumail;
	Label lbltexto;
	Label lblmensaje;
	
	TextField txttunombre;
	TextField txttumail;
	TextField txtsunombre;
	TextField txtsumail;
	TextField txttexto;

	Button aceptar;
	Button preliminar;
	Button nueva;

	public void init(){
		String fila;

		try{		
			fila=getParameter("fila");
			if (fila!=null)
				fil=Integer.parseInt(fila);
		}
		catch (NumberFormatException e){}

		fotosel=-1;
		setLayout(new BorderLayout());
		
		p=new Panel();
		p.setLayout(new GridLayout(13,1));
		add("South",p);

		lbltunombre=new Label("Tu nombre");
		p.add(lbltunombre);

		txttunombre=new TextField(30);
		p.add(txttunombre);

		lbltumail=new Label("Tu mail");
		p.add(lbltumail);

		txttumail=new TextField(30);
		p.add(txttumail);

		lblsunombre=new Label("Su nombre");
		p.add(lblsunombre);

		txtsunombre=new TextField(30);
		p.add(txtsunombre);

		lblsumail=new Label("Su mail");
		p.add(lblsumail);
	
		txtsumail=new TextField(30);
		p.add(txtsumail);

		lbltexto=new Label("Texto (Max. 500 caracteres)");
		p.add(lbltexto);

		txttexto=new TextField();
		p.add(txttexto);

		aceptar=new Button("Aceptar");
		p.add(aceptar);
		preliminar=new Button("Preliminar");
		p.add(preliminar);
		nueva=new Button("Nueva");
		p.add(nueva);

Esto funciona correctamente. El problema es que quiero definir
txttexto como un TextArea pero al a�adir el textArea al Applet este se
deforma totalmente y solo aparecen 3 botones grandes y parte del area
de texto. Es decir, cambio las lines:

		txttexto=new TextField();
		p.add(txttexto);

por
		txttexto=new TextArea();
		p.add(txttexto);
		 (en la definicion de txttexto tambien pongo TextArea)

�Alguien sabe que puede suceder???
Gracias por vuestra atencion!!
************************
*                      *
* Javier Z�rate Alonso *
*                      *
*    jalonso@jet.es    *
*                      *
************************
Technical Details
Message-ID: <3489d1b3.4961710@news.jet.es>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 1116f3,f02df638b1806016,start
X-Google-Attributes: gid1116f3,public
From: jalonso@jet.es (Javier Z�rate Alonso)
Subject: TextField - TextArea
Date: 1997/12/06
Message-ID: <3489d1b3.4961710@news.jet.es>
X-Deja-AN: 295860551
Organization: Unisource Espana NEWS SERVER
Newsgroups: es.comp.lenguajes.java