如何用java编写一个简单的文本编辑器?

Python011

如何用java编写一个简单的文本编辑器?,第1张

import java.awt.*\x0d\x0aimport java.awt.event.*\x0d\x0aimport javax.swing.*\x0d\x0aimport java.io.*\x0d\x0a\x0d\x0apublic class f1 extends Frame implements ActionListener\x0d\x0a{\x0d\x0aprivate MenuBar menubar=new MenuBar()\x0d\x0aprivate Menu filemenu=new Menu("文件")\x0d\x0aprivate Menu editmenu=new Menu("编辑")\x0d\x0aprivate Menu formmenu=new Menu("格式")\x0d\x0aprivate MenuItem[] itemf=new MenuItem[4]\x0d\x0aprivate MenuItem[] iteme=new MenuItem[6]\x0d\x0aprivate MenuItem[] items=new MenuItem[2]\x0d\x0aprivate TextArea tf=new TextArea()\x0d\x0a\x0d\x0apublic int a=0,b=0,c=0,style=Font.PLAIN,size=15\x0d\x0apublic String s1="red:"+a+" "+"green:"+b+" "+"blue"+c,\x0d\x0as2="宋体"\x0d\x0a\x0d\x0apublic String[] sz1={"10","16","24","30","32","36"},\x0d\x0asz2={"宋体","黑体","幼圆","隶书","行楷","Arial","Georgia"},\x0d\x0asz3={"粗体","倾斜","常规","粗斜"}\x0d\x0a\x0d\x0aJDialog dialog=new JDialog(this,"字体",true)\x0d\x0aContainer cp=dialog.getContentPane()\x0d\x0aJLabel[] lb=new JLabel[8]\x0d\x0aJLabel lb1=new JLabel(s1,JLabel.LEFT)\x0d\x0aJButton b1=new JButton("确定"),\x0d\x0ab2=new JButton("取消")\x0d\x0aJComboBox jc1=new JComboBox(),\x0d\x0ajc2=new JComboBox(),\x0d\x0ajc3=new JComboBox()\x0d\x0aJScrollBar jb1=new JScrollBar(JScrollBar.HORIZONTAL,10,5,0,260)\x0d\x0aJScrollBar jb2=new JScrollBar(JScrollBar.HORIZONTAL,10,5,0,260)\x0d\x0aJScrollBar jb3=new JScrollBar(JScrollBar.HORIZONTAL,10,5,0,260)

5.19软件java班级免费下载  

链接:https://pan.baidu.com/s/1J2uKomN_yWZHGthTR5HZOg

提取码:mcpa

Java是一门面向对象编程语言,不仅吸收了C++语言的各种优点,还摒弃了C++里难以理解的多继承、指针等概念,因此Java语言具有功能强大和简单易用两个特征。Java语言作为静态面向对象编程语言的代表,极好地实现了面向对象理论,允许程序员以优雅的思维方式进行复杂的编程 。