variable1.setText(String.valueOf(variable2));

equix
14 de Septiembre del 2009
variable1.setText(String.valueOf(variable2));
me podrian ayudar con esta parte de codigo
porfavor

santos.r09
14 de Septiembre del 2009
pusiste esta pregunta en forodejava . com?

variable.setText //setText, es el metodo que se utiliza para colocar el valor a la variable(set-colocas el valor, get-obtienes el valor -getValor)
(String.valueOf(variable2)); // "valueOf" es un método de la clase String, y acepta diferentes argumentos(float, char, long, object, array char), lo que hace valueOf es devolver la representacion de cadena del tipo de objeto o primitivo que se trate. checa el api de java si no te queda claro.

aqui una parte del api de Java de la clase String:

static String valueOf(boolean b)
Returns the string representation of the boolean argument.
static String valueOf(char c)
Returns the string representation of the char argument.
static String valueOf(char[] data)
Returns the string representation of the char array argument.
static String valueOf(char[] data, int offset, int count)
Returns the string representation of a specific subarray of the char array argument.
static String valueOf(double d)
Returns the string representation of the double argument.
static String valueOf(float f)
Returns the string representation of the float argument.
static String valueOf(int i)
Returns the string representation of the int argument.
static String valueOf(long l)
Returns the string representation of the long argument.
static String valueOf(Object obj)
Returns the string representation of the Object argument.

Saludos.

favrycio
14 de Septiembre del 2009
En tu clase declaras
protected JTextField jTextField1=new JTextField();
protected JLabel jLabel1=new JLabel();

luego en le constructor o donde quieras pones
jTextField1.setText("cualquier maricada");
jLabel.setText=("<html>Aqui en lo jlabel puedes poner html</html>");