That’s not how you’re supposed to do it…There’s good reason for the JComponent class (or Component, if you’re avoiding Swing).
Only about 5 lines of code to do the app version, and a further 5 for the applet version, of a java prog written as a (J)Component. No need to much about with creating new Frames. (PS this is one of the parts of swing/awt documentation that drivers me up the wall: Why has Sun never fully and carefully explained this? - there is a Sun mini-tutorial on it, but it is incomplete and only describes some scenarios. Surely one of the most frequently encountered problems…).
PS, it may not be affecting you now, but if you use any GUI widgets - ever! - I would very strongly suggest not bothering providing things that “work on JDK 1.1”; I’ve been trying to myself for years, and recently gave up. The reasoning is very sad and depressing - Sun has many outstanding AWT bugs that they allegedly never bothered fixing because “there’s a better version of that widget/component that comes with Swing; use that instead” (that’s the short summary). How accurate a reason this is is debatable, but the support for 1.1.x is not good in the GUI…
e.g. I noticed that some of the long-standing bugs (for many YEARS!) in TextArea only just got fixed (IIRC with 1.4.2 beta). This includes showstoppers that have caused projects I’ve worked on to have to write their own complete replacements for TextArea. Sigh.
e.g. The modulus operator in JDK 1.3.x is broken, and the bug has been marked “WONTFIX”, apparently merely because it was too hard for the engineer to fix (I logged the bug, he refused to fix it. Sigh).