poner datos en Gui desde otra clase
Publicado por Isabel (35 intervenciones) el 06/08/2005 17:20:06
Hola
Tengo dos clases. Desde la clase Primer se llama a la clase Gui04. Despues quiero ejecutar el método "actualitzarWindow" y no puedo. Alguien puede ayudarme?
Gracias!
Isabel
public class Gui04 extends JFrame implements ActionListener
{
----------
ee = new Pacient();
ee.actualitzar(this);
-------------
public void actualitzarWindow(int x)
{
System.out.println("PINNNTATTTTTTTt");
this.casellescontrincant[1][2].setBackground(vcolor[8]);
this.casellescontrincant[4][2].setBackground(vcolor[8]);
this.casellescontrincant[5][7].setBackground(vcolor[8]);
}
}
---------------------------------------------------
public class Primer
{
protected JFrame frame = null;
Gui04 k;
public Primer()
{
try {
frame = new Gui04();
frame.setTitle("Planificador d'ambulàncies");
frame.setSize(800,600);
frame.setVisible(true);
}
catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args)
{
new Primer();
k.actualitzarWindow(8);
}
}
Tengo dos clases. Desde la clase Primer se llama a la clase Gui04. Despues quiero ejecutar el método "actualitzarWindow" y no puedo. Alguien puede ayudarme?
Gracias!
Isabel
public class Gui04 extends JFrame implements ActionListener
{
----------
ee = new Pacient();
ee.actualitzar(this);
-------------
public void actualitzarWindow(int x)
{
System.out.println("PINNNTATTTTTTTt");
this.casellescontrincant[1][2].setBackground(vcolor[8]);
this.casellescontrincant[4][2].setBackground(vcolor[8]);
this.casellescontrincant[5][7].setBackground(vcolor[8]);
}
}
---------------------------------------------------
public class Primer
{
protected JFrame frame = null;
Gui04 k;
public Primer()
{
try {
frame = new Gui04();
frame.setTitle("Planificador d'ambulàncies");
frame.setSize(800,600);
frame.setVisible(true);
}
catch(Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args)
{
new Primer();
k.actualitzarWindow(8);
}
}
Valora esta pregunta


0