diff --git a/src/java2020spring/About.java b/src/java2020spring/About.java new file mode 100644 index 0000000000000000000000000000000000000000..65a030580c5a7ae069bdf1bf938411d80fda970c --- /dev/null +++ b/src/java2020spring/About.java @@ -0,0 +1,26 @@ +package java2020spring; + +import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; + +import javax.swing.*; + +public class About extends JDialog{ + JLabel text; +About(JFrame f){ + super(f); + setTitle("关于“记事本”"); + text=new JLabel("版本:1.0 " + "制作者:202025710108信管一班黄紫铃"); + add(text); + setBounds(100,100,350,170); + setDefaultCloseOperation(DISPOSE_ON_CLOSE); + validate(); + +} + + + +} diff --git a/src/java2020spring/FontDialog.java b/src/java2020spring/FontDialog.java new file mode 100644 index 0000000000000000000000000000000000000000..d412cbdbd77aaba6224301111c499348b60281bc --- /dev/null +++ b/src/java2020spring/FontDialog.java @@ -0,0 +1,87 @@ +package java2020spring; + +import java.awt.*; + +import java.awt.event.*; + +import javax.swing.*; + +public class FontDialog extends JDialog implements ItemListener,ActionListener{ + FontFamilyNames fontFamilyNames; + int fontSize=38; + String fontName; + JComboBox fontNameList,fontSizeList; + JLabel label; + Font font; + JButton yes,cancel; + static int YES=1,NO=0; + int state=-1; + FontDialog(JFrame f){ + super(f);//? + setTitle("字体设置"); + font =new Font("宋体",Font.PLAIN,12); + fontFamilyNames=new FontFamilyNames(); + setModal(true); + yes=new JButton("Yes"); + cancel=new JButton("cancel"); + yes.addActionListener(this); + cancel.addActionListener(this); + label=new JLabel("AaBbYyZz",JLabel.CENTER); + fontNameList=new JComboBox(); + fontSizeList=new JComboBox(); + String name[]=fontFamilyNames.getFontName(); + fontNameList.addItem("字体"); + for(int k=0;k