How (and where) do I destroy a control that I added through Right-Click->Insert Activex Component in a composite control window

This activex launches a JVM and I want to be able to sut down the jvm too, but everytime I call System.exit() in the java code, it crashes the host too.