锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品国产精品亚洲综合,欧美亚洲精品一区,亚洲国产综合91精品麻豆http://www.aygfsteel.com/luffy520/zh-cnSun, 06 Jul 2025 04:18:52 GMTSun, 06 Jul 2025 04:18:52 GMT60璁板繂鍔涙祴璇?/title><link>http://www.aygfsteel.com/luffy520/archive/2005/12/18/24457.html</link><dc:creator>luffy520</dc:creator><author>luffy520</author><pubDate>Sun, 18 Dec 2005 02:44:00 GMT</pubDate><guid>http://www.aygfsteel.com/luffy520/archive/2005/12/18/24457.html</guid><wfw:comment>http://www.aygfsteel.com/luffy520/comments/24457.html</wfw:comment><comments>http://www.aygfsteel.com/luffy520/archive/2005/12/18/24457.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/luffy520/comments/commentRss/24457.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/luffy520/services/trackbacks/24457.html</trackback:ping><description><![CDATA[<P>import javax.swing.*;<BR>import java.awt.*;<BR>import java.awt.event.*;<BR>import java.io.*;<BR>import java.util.LinkedList;<BR>public class Memory extends JFrame implements ActionListener<BR>{ <BR>  JMenuBar bar;<BR>  JMenu fileMenu;<BR>  JMenuItem 鍒濈駭,涓駭,楂樼駭,鍒濈駭鎺掕姒?涓駭鎺掕姒?楂樼駭鎺掕姒?<BR>  Block block[];<BR>  ImageIcon icon[];<BR>  MemoryTestPane 璁板繂嫻嬭瘯鏉?null;<BR>  File file鍒濈駭=new File("鍒濈駭璁板繂鎺掕姒?txt"),<BR>       file涓駭=new File("涓駭璁板繂鎺掕姒?txt"),<BR>       file楂樼駭=new File("楂樼駭璁板繂鎺掕姒?txt");</P> <P>  LinkedList 鎴愮嘩琛?null;<BR>  ShowRecord 鏄劇ず鎴愮嘩琛ㄥ璇濇=null;<BR>  int m=5,n=6;                                        <BR>  int 鍥炬爣涓暟=0;<BR>  Container con=null;<BR>  JTextField 鎻愮ず鏉?null;<BR>  File gradeFile=null;            <BR>  public  Memory()<BR>  { <BR>    block=new Block[m*n];<BR>    鍥炬爣涓暟=m; <BR>    icon=new ImageIcon[鍥炬爣涓暟];<BR>    for(int i=0;i<icon.length;i++)<BR>       {<BR>         icon[i]=new ImageIcon("a"+i+".gif");<BR>       } <BR>    for(int i=0;i<block.length;i++)<BR>       {<BR>         block[i]=new Block();<BR>         block[i].璁劇疆鍏抽棴鏃剁殑鍥炬爣(new ImageIcon("鍏抽棴.gif"));<BR>       }<BR>  <BR>    bar=new JMenuBar();<BR>    fileMenu=new JMenu("璁板繂鍔涙祴璇?);<BR>    鍒濈駭=new JMenuItem("鍒濈駭");<BR>    涓駭=new JMenuItem("涓駭");<BR>    楂樼駭=new JMenuItem("楂樼駭");<BR>    fileMenu.setMnemonic('G');<BR>    鍒濈駭.setMnemonic('B');<BR>    涓駭.setMnemonic('I');<BR>    楂樼駭.setMnemonic('E');<BR>    楂樼駭鎺掕姒?new JMenuItem("楂樼駭鎺掕姒?);<BR>    涓駭鎺掕姒?new JMenuItem("涓駭鎺掕姒?);<BR>    鍒濈駭鎺掕姒?new JMenuItem("鍒濈駭鎺掕姒?);<BR>    鍒濈駭.setMnemonic('T');<BR>    fileMenu.add(鍒濈駭);<BR>    fileMenu.add(涓駭);<BR>    fileMenu.add(楂樼駭);<BR>    fileMenu.add(鍒濈駭鎺掕姒?;<BR>    fileMenu.add(涓駭鎺掕姒?;<BR>    fileMenu.add(楂樼駭鎺掕姒?;<BR>    bar.add(fileMenu);<BR>    setJMenuBar(bar);<BR>    鍒濈駭.addActionListener(this);<BR>    涓駭.addActionListener(this);<BR>    楂樼駭.addActionListener(this);<BR>    鍒濈駭鎺掕姒?addActionListener(this);<BR>    涓駭鎺掕姒?addActionListener(this);<BR>    楂樼駭鎺掕姒?addActionListener(this);<BR>    鎴愮嘩琛?new LinkedList();<BR>    if(!file鍒濈駭.exists())                         <BR>     {<BR>      try{<BR>          FileOutputStream out=new FileOutputStream("鍒濈駭璁板繂鎺掕姒?txt");<BR>          ObjectOutputStream object_out=new ObjectOutputStream(out);<BR>          object_out.writeObject(鎴愮嘩琛?;<BR>          object_out.close();<BR>          out.close();<BR>         }<BR>      catch(IOException e)<BR>         {<BR>         }<BR>     } <BR>     if(!file涓駭.exists())<BR>     {<BR>      try{<BR>          FileOutputStream out=new FileOutputStream("涓駭璁板繂鎺掕姒?txt");<BR>          ObjectOutputStream object_out=new ObjectOutputStream(out);<BR>          object_out.writeObject(鎴愮嘩琛?;<BR>          object_out.close();<BR>          out.close();<BR>         }<BR>      catch(IOException e)<BR>         {<BR>         }<BR>     } <BR>     if(!file楂樼駭.exists())<BR>     {<BR>      try{<BR>          FileOutputStream out=new FileOutputStream("楂樼駭璁板繂鎺掕姒?txt");<BR>          ObjectOutputStream object_out=new ObjectOutputStream(out);<BR>          object_out.writeObject(鎴愮嘩琛?;<BR>          object_out.close();<BR>          out.close();<BR>         }<BR>      catch(IOException e)<BR>         {<BR>         }<BR>     } <BR>    gradeFile=file鍒濈駭;<BR>    setBounds(100,100,300,260);<BR>    setVisible(true);<BR>    addWindowListener(new WindowAdapter()<BR>      {<BR>        public void windowClosing(WindowEvent e)<BR>         {<BR>          System.exit(0);<BR>         }<BR>      });<BR>    con=getContentPane(); <BR>    璁板繂嫻嬭瘯鏉?new MemoryTestPane(block,icon,m,n,gradeFile);<BR>    鎻愮ず鏉?new JTextField("鍒濈駭錛氭偍闇瑕佽繛緇壘鍑?+6+"涓浉鍚屽浘鏍囩殑鏂瑰潡"); <BR>    鎻愮ず鏉?setEditable(false);<BR>    鎻愮ず鏉?setForeground(Color.red);<BR>    con.add(璁板繂嫻嬭瘯鏉?BorderLayout.CENTER);<BR>    con.add(鎻愮ず鏉?BorderLayout.SOUTH);<BR>    con.validate();<BR>    this.validate();<BR> }<BR> public void 緇欏嚭綰у埆嫻嬭瘯(int 瀹?int 楂?File f)<BR> {    <BR>    m=瀹?<BR>    n=楂?<BR>    鍥炬爣涓暟=m;<BR>    gradeFile=f;<BR>    block=new Block[m*n];<BR>    icon=new ImageIcon[鍥炬爣涓暟];<BR>       for(int i=0;i<icon.length;i++)<BR>       {<BR>         icon[i]=new ImageIcon("a"+i+".gif");<BR>       } <BR>    for(int i=0;i<block.length;i++)<BR>       {<BR>         block[i]=new Block();<BR>         block[i].璁劇疆鍏抽棴鏃剁殑鍥炬爣(new ImageIcon("鍏抽棴.gif"));<BR>       }<BR>    璁板繂嫻嬭瘯鏉?new MemoryTestPane(block,icon,m,n,gradeFile);<BR>    con.removeAll();<BR>    con.add(璁板繂嫻嬭瘯鏉?BorderLayout.CENTER);<BR>    con.add(鎻愮ず鏉?BorderLayout.SOUTH);<BR>    con.validate();<BR>    this.validate();<BR> }<BR> public void actionPerformed(ActionEvent event)<BR> { <BR>   if(event.getSource()==鍒濈駭) <BR>       {  <BR>         緇欏嚭綰у埆嫻嬭瘯(5,6,file鍒濈駭);<BR>         setBounds(100,100,300,260);<BR>         this.validate();<BR>         鎻愮ず鏉?setText("鍒濈駭錛氭偍闇瑕佽繛緇壘鍑?+6+"涓浉鍚屽浘鏍囩殑鏂瑰潡");<BR>       }<BR>   if(event.getSource()==涓駭) <BR>       {<BR>         緇欏嚭綰у埆嫻嬭瘯(6,7,file涓駭);<BR>         setBounds(100,100,340,280);<BR>         this.validate();<BR>         鎻愮ず鏉?setText("涓駭錛氭偍闇瑕佽繛緇壘鍑?+7+"涓浉鍚屽浘鏍囩殑鏂瑰潡");<BR>       }<BR>   if(event.getSource()==楂樼駭) <BR>       {  <BR>         緇欏嚭綰у埆嫻嬭瘯(7,8,file楂樼駭);<BR>         setBounds(100,100,360,300);<BR>         this.validate();<BR>         鎻愮ず鏉?setText("楂樼駭錛氭偍闇瑕佽繛緇壘鍑?+8+"涓浉鍚屽浘鏍囩殑鏂瑰潡");<BR>       }<BR>   if(event.getSource()==楂樼駭鎺掕姒?<BR>       {<BR>         鏄劇ず鎴愮嘩琛ㄥ璇濇=new ShowRecord(this,file楂樼駭);<BR>         鏄劇ず鎴愮嘩琛ㄥ璇濇.setVisible(true);<BR>       }<BR>    if(event.getSource()==涓駭鎺掕姒?<BR>       {<BR>         鏄劇ず鎴愮嘩琛ㄥ璇濇=new ShowRecord(this,file涓駭);<BR>         鏄劇ず鎴愮嘩琛ㄥ璇濇.setVisible(true);<BR>       }<BR>     if(event.getSource()==鍒濈駭鎺掕姒?<BR>       {<BR>         鏄劇ず鎴愮嘩琛ㄥ璇濇=new ShowRecord(this,file鍒濈駭);<BR>         鏄劇ず鎴愮嘩琛ㄥ璇濇.setVisible(true);<BR>       }<BR> } </P> <P> public static void main(String args[])<BR>  {<BR>    new Memory();<BR>  }<BR>}</P><img src ="http://www.aygfsteel.com/luffy520/aggbug/24457.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/luffy520/" target="_blank">luffy520</a> 2005-12-18 10:44 <a href="http://www.aygfsteel.com/luffy520/archive/2005/12/18/24457.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍧氭寔--http://www.aygfsteel.com/luffy520/archive/2005/12/12/23513.htmlluffy520luffy520Mon, 12 Dec 2005 09:09:00 GMThttp://www.aygfsteel.com/luffy520/archive/2005/12/12/23513.htmlhttp://www.aygfsteel.com/luffy520/comments/23513.htmlhttp://www.aygfsteel.com/luffy520/archive/2005/12/12/23513.html#Feedback0http://www.aygfsteel.com/luffy520/comments/commentRss/23513.htmlhttp://www.aygfsteel.com/luffy520/services/trackbacks/23513.html
鍙兂璇佹槑緇欒嚜宸辯湅鎴戣兘鍋氬埌--鍙樺己


luffy520 2005-12-12 17:09 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 大竹县| 宣威市| 天等县| 齐齐哈尔市| 天气| 伊宁市| 黑龙江省| 奇台县| 朝阳市| 华池县| 兰西县| 红河县| 通海县| 邛崃市| 沅江市| 黄冈市| 泸西县| 岳阳市| 金乡县| 阿勒泰市| 麻阳| 民勤县| 壤塘县| 合肥市| 襄垣县| 泸定县| 磐石市| 洪雅县| 福州市| 白河县| 隆回县| 柯坪县| 安庆市| 稻城县| 通州市| 绥芬河市| 靖边县| 台东县| 漳平市| 五大连池市| 沾益县|