Abilash Ravichandran
Abilash Ravichandran

Reputation: 449

How to close Internal Frames?

I had placed several internal frames in a desktop pane namely

JInternalFrame frameint1 = new JInternalFrame("Question 1", true,true, true, true);

I was able to maximize and minimize but I was not able to close the internal frame. Please help me.

Upvotes: 1

Views: 4858

Answers (2)

ADC
ADC

Reputation: 11

But remember that for the jInternalFrame.setclosed(true); you must surround this in a try-catch. This will normally be suggested if you are using an IDE

try {
      jInternalFrame.setClosed(true);
    } catch (PropertyVetoException ex) {
        System.err.println("Closing Exception");
    }

hope this helps

Upvotes: 0

Erik Pragt
Erik Pragt

Reputation: 14637

You have to call setClosed(), as specified in the doc:

jinternalFrame.setClosed(true)

Upvotes: 5

Related Questions