{"id":342,"date":"2012-06-10T14:39:17","date_gmt":"2012-06-10T06:39:17","guid":{"rendered":"http:\/\/wangkaixuan.tech\/?p=342"},"modified":"2020-06-06T14:40:03","modified_gmt":"2020-06-06T06:40:03","slug":"%e5%a5%bd%e7%8e%a9%e7%9a%84%e7%aa%97%e5%8f%a3-%e5%9f%ba%e6%9c%ac%e7%89%88","status":"publish","type":"post","link":"http:\/\/www.wangkaixuan.tech\/?p=342","title":{"rendered":"\u597d\u73a9\u7684\u7a97\u53e3 \u57fa\u672c\u7248"},"content":{"rendered":"\n<p>\u8bd5\u8bd5\u6309\u4e0b\u65b9\u5411\u952e\u3002\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import java.awt.*;\nimport java.awt.event.*;\nimport java.util.*;\n \n \nclass Test{\n\tpublic static void main(String&#91;] args){\n\t\tnew MyFrame(\"Drawing...\");\n\t}\t\n}\n \nclass MyFrame extends Frame{\n\tint x=300;\n\tint y=300;\n\tint w=400;\n\tint h=300;\n\tprivate int num=0;\n\tMyFrame(String s){\n\t\tsuper(s);\n\t\tsetBounds(x,y,w,h);\n\t\tsetResizable(false);\n\t\taddKeyListener(new KeyAdapter(){\n\t\t\tpublic void keyPressed(KeyEvent e){\n\t\t\t\t\tswitch(e.getKeyCode()){\n\t\t\t\t\t\tcase KeyEvent.VK_UP:\n\t\t\t\t\t\t\ty-=50;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase KeyEvent.VK_DOWN:\n\t\t\t\t\t\t\ty+=50;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase KeyEvent.VK_LEFT:\n\t\t\t\t\t\t\tx-=50;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase KeyEvent.VK_RIGHT:\n\t\t\t\t\t\t\tx+=50;\n\t\t\t\t\t\t\tbreak;\t\t\n\t\t\t\t\t}\n\t\t\t\t\tsetBounds(x,y,w,h);\n\t\t\t}\n\t\t});\n\t\tsetVisible(true);\n\t\tthis.addWindowListener(new WindowAdapter(){\n\t\t\tpublic void windowClosing(WindowEvent e){\n\t\t\t\tsetVisible(false);\n\t\t\t\tSystem.exit(0);\t\n\t\t\t}\n\t\t});\n\t}\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8bd5\u8bd5\u6309\u4e0b\u65b9\u5411\u952e\u3002\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-342","post","type-post","status-publish","format-standard","hentry","category-06-03-play-ground"],"_links":{"self":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/posts\/342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=342"}],"version-history":[{"count":0,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/posts\/342\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=342"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}