Cerberus 17 Junior Poster

I pulled out this object oriented tutorial that you might find quite good.

http://sepwww.stanford.edu/sep/josman/oop/oop1.htm

peter_budo commented: I do not fancy design of that site, but that idea of introducing OOP is good +7
no1zson commented: always trys to help +1
Cerberus 17 Junior Poster

This might be helpful www.osdev.org

Rashakil Fol commented: A useful (!) post! +9
Cerberus 17 Junior Poster
JFrame f = new JFrame();

//disable the close button
f.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

//create custom close operation
f.addWindowListener(new WindowAdapter()
{
      public void windowClosing(WindowEvent e)
      {
          exitProcedure();
      }
});

in the exitProcedure method i just use an if else ladder to work out if i need to save or exit etc.

leiger commented: Thanks! I needed this solution and this was the only place I found it! +0