Ver Mensaje Individual
  #3 (permalink)  
Antiguo 20/04/2015, 09:59
avilavalenz
 
Fecha de Ingreso: abril-2015
Mensajes: 5
Antigüedad: 9 años, 5 meses
Puntos: 0
Respuesta: Cambiar propiedades de componentes

Muchas gracias. Creo que te debo una. La solución quedaría así:

import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;

public class Cambiar extends JFrame {
private JPanel contentPane;
static JButton boton = new JButton("New button");
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
Cambiar frame = new Cambiar();
frame.setVisible(true);
}
});
actualiza();
}
public static void actualiza(){
boton.setText("Muchas gracias Xerelo");
}
public Cambiar() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
boton.setBounds(107, 61, 162, 97);
contentPane.add(boton);
}
}

Agradezco mucho tu tiempo y pronta respuesta.