Java SE Help....

DJvodka

Well-known member
  • Mar 31, 2009
    3,375
    292
    83
    A land like no other

    Mang venama hadala tiyana frame ekak JDialog ekak vidiyata call karanna puluvanda???

    Puluwan. Mehemai, mulinma oya child frame ake constructor eken Parent frame eke reference ekak ganna. Ita passe Chid frame ake WindowClosing event eka override karala eke liyanna parent frame eka enable karanna kiyala. Eg:-

    Write this on the Parent first.
    Child c = new Child(this);
    this.setEnabled(false);
    c.setVisible(true);

    Now write this on the Child class

    public class Child{

    Parent p;
    public Child(Parent p){
    this.p = p;
    }

    addWindowListener(WindowAdapter() {
    public void windowClosing(WindowEvent evt) {
    p.setEnabled(true);
    setVisible(false);
    }
    });
     

    ozone_buzzer

    Well-known member
  • Aug 6, 2007
    2,898
    80
    48
    Colombo
    Puluwan. Mehemai, mulinma oya child frame ake constructor eken Parent frame eke reference ekak ganna. Ita passe Chid frame ake WindowClosing event eka override karala eke liyanna parent frame eka enable karanna kiyala. Eg:-

    Write this on the Parent first.
    Child c = new Child(this);
    this.setEnabled(false);
    c.setVisible(true);

    Now write this on the Child class

    public class Child{

    Parent p;
    public Child(Parent p){
    this.p = p;
    }

    addWindowListener(WindowAdapter() {
    public void windowClosing(WindowEvent evt) {
    p.setEnabled(true);
    setVisible(false);
    }
    });

    Maxxa... Thanks you so much. I will try this and let you know macho...