ÄÚÈÝ·¢²¼¸üÐÂʱ¼ä : 2025/7/27 2:37:53ÐÇÆÚÒ» ÏÂÃæÊÇÎÄÕµÄÈ«²¿ÄÚÈÝÇëÈÏÕæÔĶÁ¡£
} filedialog_load.getFile()); file_reader=new FileReader(file); in=new BufferedReader(file_reader); while((s=in.readLine())!=null) area.append(s+'\\n'); in.close(); file_reader.close(); } catch(IOException e1) {} } else if(e.getSource()==item1) { area.setText(null); } else if(e.getSource()==item2) { area.cut(); } else if(e.getSource()==item3) { area.copy(); } else if(e.getSource()==item4) { area.paste(); } else if(e.getSource()==item5) { Color newColor=JColorChooser.showDialog(this,\µ÷É«°å\if(newColor!=null) area.setBackground(newColor); } else if(e.getSource()==item6) { zhuti zt=new zhuti(); } else if(e.getSource()==item7) { System.exit(0); } else if(e.getSource()==item8) { Font font=area.getFont(); int style=font.getStyle(); style=style^0; area.setFont(new Font(\ } else if(e.getSource()==item9) { Font font=area.getFont(); int style=font.getStyle(); style=style^2; area.setFont(new Font(\ } else if(e.getSource()==item10) { Font font=area.getFont(); int style=font.getStyle(); style=style^1; area.setFont(new Font(\ } } else if(e.getSource()==item11) { Font font=area.getFont(); int style=font.getStyle(); area.setFont(new Font(font.getName(),style,12)); } else if(e.getSource()==item12) { Font font=area.getFont(); int style=font.getStyle(); area.setFont(new Font(font.getName(),style,24)); } else if(e.getSource()==item13) { Font font=area.getFont(); int style=font.getStyle(); area.setFont(new Font(font.getName(),style,36)); } else if(e.getSource()==item14) { chazhao cz=new chazhao(); } } class zhuti extends Frame implements ActionListener { Button btn; Label lab; zhuti() { setLayout(null); btn=new Button(\È·¶¨\ lab=new Label(\ÕâÊÇÒ»¸ö¼òµ¥µÄÎı¾±à¼Æ÷!\ } add(btn); add(lab); btn.addActionListener(this); setBounds(200,200,250,150); setVisible(true); lab.setBounds(20 ,60,220,30); lab.setFont(new Font(\¿¬Ìå\lab.setBackground(Color.cyan); btn.setBounds(100,100,50,30); btn.setBackground(Color.cyan); } public void actionPerformed(ActionEvent e) { if(e.getSource()==btn) { } dispose(); } public class MyWork { public static void main(String args[]) { Window win=new Window(\ÌðÌðµÄÎı¾±à¼Æ÷\} } 5.¿Î³ÌÉè¼ÆÐĵà ±¾´Î¿Î³ÌÉè¼ÆÎÒÑ¡×öµÄÌâÄ¿ÊÇÎı¾±à¼Æ÷µÄÉè¼ÆÓëʵÏÖ. ÒªÇóÉè¼ÆÒ»¸öÀàËÆÓÚWindows¼Çʱ¾(Notepad)µÄJava³ÌÐò,¿ÉÒÔ´ò¿ª¡¢Ð½¨¡¢±£´æÒ»¸öÎı¾Îļþ,¶øÇÒÄܶÔÑ¡ÖеÄÎı¾½øÐи÷Öֱ༲Ù×÷,ÈçÉèÖÃ×ÖÌå¡¢±³¾°¡¢¸´ÖÆ¡¢Õ³Ìù. Õâ´ÎʵÑéÖÐÎÒÉè¼ÆµÄÎı¾±à¼Æ÷¿ÉÒÔʵÏÖ´ò¿ª, н¨,±£´æ,¸´ÖÆ,Õ³Ìù,¼ôÌù,±³¾°,¼°°ïÖúÖ÷ÌâÕâЩ¹¦ÄÜ.ÏÈÔÚWindowÀàÖÐÌí¼ÓһϵÁÐ×é¼þ,ÈçButton,JtextArea,MenuµÈ,ÔÙ¶ÔÏàÓ¦µÄ×é¼þÌí¼Ó¼àÌý,È»ºóÔÚ¸÷×Ô¶ÔÓ¦µÄ·½·¨ÖÐÀ´ÊµÏÖ¸÷×ԵŦÄÜ. ÏÈÉèÖÃÁËËĸö²Ëµ¥,·Ö±ðΪÎļþ,±à¼,¸ñʽºÍ°ïÖú. ½«´ò¿ª, н¨,±£´æ·ÅÈëÎļþ²Ëµ¥ÖÐ, ¸´ÖÆ,Õ³Ìù,¼ôÌù·ÅÈë±à¼²Ëµ¥ÖÐ,±³¾°ºÍ¹ØÓÚÖ÷Ìâ·Ö±ðÔÚ¸ñʽºÍ°ïÖú²Ëµ¥ÖÐ. ͨ¹ýÕâ´ÎµÄ¿Î³ÌÉè¼Æ£¬Ó¦¸Ã˵ÊÕÒæ·Ëdz£¬ÒòΪ³ÌÐò¶¼ÊÇ×Ô¼ºÐ´µÄ£¬ËùÒԸд¥¸üÉî¡£ÒÔǰÓÐÒ»Ð©ËÆ¶®·Ç¶®µÄ֪ʶµãͨ¹ýÕâ´ÎÊÔÑéÓÐÁËÈ«ÃæµÄÁ˽⣬¸üÖØÒªµÄÊǵõ½ÁËÐí¶àеÄ֪ʶ¡£ ¶øÇÒÔÚÕâ´ÎÊÔÑéÖг¢ÊÔÁËÐí¶àÒÔǰûÓÐÓùýµÄ·½·¨À´ÊµÏÖһЩ¹¦ÄÜ£¬±ÈÈç¶Ô»°¿òµÄʹÓõȵȡ£ÓÐÁËÕâ´Î¿Î³ÌÉè¼ÆµÄÌåÑ飬ÏàÐÅÔÚÒÔºóµÄ±à³ÌÄËÖÁѧϰÖлá´ÓÖеõ½Ò»Ð©¾Ñé¡£ ²Î¿¼ÎÄÏ×£º [1] ¹¢ÏéÒå,ÕÅÔ¾Æ½Öø.Java2ʵÓý̳Ì(µÚÈý°æ)[M].Ç廪´óѧ³ö°æÉç,2006 [2] ³Â¼ÒÐË,³Â·ç,Öì¹úºèÖø.JavaͼÐÎÓû§½çÃæÉè¼ÆÓëʵÀý[M].Ò±½ð¹¤Òµ³ö°æÉç,2004 [3]¡¶Java2ʹÓý̳̣¨µÚÈý°æ£©¡·¹¢ÏéÒå ÕÅԾƽ±àÖø ±±¾©£ºÇ廪´óѧ³ö°æÉç,2007 [4] InternetÉϵÄ×ÊÔ´