OS X - Can't quit program with "Apple Q"

[email protected] Sat, 13 Aug 2005 21:19:40 -0400
Newsgroups gmane.comp.embedded.carlsbad-cubes
Message-ID <[email protected]>
--===============0561810635==
Content-Type: multipart/alternative; boundary=Apple-Mail-1-406374347


--Apple-Mail-1-406374347
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	delsp=yes;
	format=flowed

I am running a very simple program:

         JFrame frame = new JFrame();

         frame.setSize(200, 200);

         try {
             SwingEngine engine = new SwingEngine();

             engine.render(MainFrame.class.getResource("test.xml"));
         } catch (Exception e) {
             e.printStackTrace();
             System.exit(-1);
         }

         frame.setVisible(true);

The "test.xml" file only has the following three lines:

     <?xml version="1.0" encoding="UTF-8"?>
     <panel>
     </panel>

When I run the program on windows, I can quit the program using "Alt- 
F4". However,  on OS X, "Apple-Q" does not cause the program to quit.  
I noticed if I comment out the line:
"engine.render(MainFrame.class.getResource("test.xml"));",
the program is able to quit using "Apple Q". Anybody know why this is  
happening? What does engine.render() do that causes it to not be able  
to quit? Thanks in advance,
Andrew
--Apple-Mail-1-406374347
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=ISO-8859-1

<HTML><BODY style=3D"word-wrap: break-word; -khtml-nbsp-mode: space; =
-khtml-line-break: after-white-space; "><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I am running =
a very simple program:</DIV><DIV style=3D"margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal =
12px/normal Helvetica; min-height: 14px; "><BR></DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">=A0 =A0 =A0=A0 =A0JFrame frame =3D new =
JFrame();</DIV><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; font: normal normal normal =
12px/normal Helvetica; min-height: 14px; "><BR></DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">=A0 =A0 =A0 =A0 frame.setSize(200, 200);</DIV><P =
style=3D"margin: 0.0px 0.0px 0.0px 0.0px">=A0 =A0 =A0 =A0</P><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">=A0 =A0 =A0 =A0 try {</DIV><DIV style=3D"margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">=A0 =A0 =
=A0 =A0 =A0 =A0 SwingEngine engine =3D new SwingEngine();</DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; font: normal normal normal 12px/normal Helvetica; =
min-height: 14px; "><BR></DIV><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">=A0 =A0 =A0 =A0=
 =A0 =A0 =
engine.render(MainFrame.class.getResource("test.xml"));</DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">=A0 =A0 =A0 =A0 } catch (Exception e) {</DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">=A0 =A0 =A0 =A0 =A0 =A0 =
e.printStackTrace();</DIV><DIV style=3D"margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px; ">=A0 =A0 =A0 =A0 =A0 =A0 =
System.exit(-1);</DIV><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; ">=A0 =A0 =A0 =A0 }</DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; font: normal normal normal 12px/normal Helvetica; =
min-height: 14px; "><BR></DIV><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">=A0 =A0 =A0 =A0=
 frame.setVisible(true);</DIV><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal =
normal normal 12px/normal Helvetica; min-height: 14px; "><BR></DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">The "test.xml" file only has the following three =
lines:</DIV><P style=3D"margin: 0.0px 0.0px 0.0px 0.0px"><FONT =
class=3D"Apple-style-span" face=3D"Monaco" size=3D"3"><SPAN =
class=3D"Apple-style-span" style=3D"font-size: 11px;">=A0=A0 =
=A0</SPAN></FONT></P><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; "><FONT class=3D"Apple-style-span" =
face=3D"Monaco" size=3D"3"><SPAN class=3D"Apple-style-span" =
style=3D"font-size: 11px;">=A0=A0 =A0&lt;?xml version=3D"1.0" =
encoding=3D"UTF-8"?&gt;</SPAN></FONT></DIV><DIV style=3D"margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT =
class=3D"Apple-style-span" face=3D"Monaco" size=3D"3"><SPAN =
class=3D"Apple-style-span" style=3D"font-size: 11px;">=A0=A0 =
=A0&lt;panel&gt;</SPAN></FONT></DIV><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT =
class=3D"Apple-style-span" face=3D"Monaco" size=3D"3"><SPAN =
class=3D"Apple-style-span" style=3D"font-size: 11px;">=A0=A0 =
=A0&lt;/panel&gt;</SPAN></FONT></DIV><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal =
normal normal 11px/normal Monaco; min-height: 15px; "><BR></DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">When I run the program on windows, I can quit the =
program using "Alt-F4". However,=A0 on OS X, "Apple-Q" does not cause =
the program to quit. I noticed if I comment out the line:</DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; =
">"engine.render(MainFrame.class.getResource("test.xml"));",</DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">the program is able to quit using "Apple Q". Anybody =
know why this is happening? What does engine.render() do that causes it =
to not be able to quit? Thanks in advance,</DIV><DIV style=3D"margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; =
">Andrew</DIV></BODY></HTML>=

--Apple-Mail-1-406374347--


--===============0561810635==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Forum mailing list
[email protected]
http://carlsbadcubes.com/mailman/listinfo/forum_carlsbadcubes.com

--===============0561810635==--