See How to Write an Internal Frame Listener in The Java Tutorial and The Java Class Libraries (update) for further documentation.
WindowListener
JInternalFrame.setSelected(boolean)
JInternalFrame.setClosed(boolean)
JInternalFrame.setDefaultCloseOperation(int)
JInternalFrame.setIcon(boolean)
JInternalFrame.show()