Ver Mensaje Individual
  #3 (permalink)  
Antiguo 13/08/2008, 07:36
Avatar de Llave
Llave
 
Fecha de Ingreso: abril-2005
Ubicación: Galicia
Mensajes: 52
Antigüedad: 19 años
Puntos: 1
Respuesta: llamada a metodo de otra clase

Por extender un poco la solución que te ha dado HenrydeSousa.

Donde inicializas la variable the_panel, en vez de dejarla sin definir como has hecho tú.

Y esta es la clase que hace la llamada a la clase anterior:
------------------------------------------------
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;

public class ventana extends JFrame {
public panel the_panel;
public static void main(String args[]) {
ventana frame = new ventana();
frame.setVisible(true);
}

Prueba a inicializarla como te aconseja Henry:

public panel the_panel = newpanel();

Cuéntanos como te fue.