程序报错 frame.getContentPane().add(panel);

xinuaile 2003-10-10 02:45:37
程序报错 :---------------------Configuration: JDK version <Default>--------------------
E:\niit\Applicant.java:40: cannot resolve symbol
symbol : variable frame
location: class Applicant
frame.getContentPane().add(panel);
=====================

String []C ={"China","india","English","American"};
JList l=new JList (C);
l.setSelectionMode(2);//0only single,1 continuous-shift key,2 any sequence- ctrl key

String position[] = { "Manager","Executive", "Associate"};
comboAppPosition = new JComboBox(position);

frame.getContentPane().add(panel); ====这里报错
panel.add(labelAppID);
panel.add(textAppID);

//Adding controls for Applicant name
panel.add(labelAppName);
panel.add(textAppName);
//Adding controls for Applicant Address
panel.add(labelAppAddress);
panel.add(textAppAddress);

//Adding controls for Applicant Position
panel.add(labelAppPosition);
panel.add(comboAppPosition);
panel.add(l);

//Create a panel


//Create and add the appropriate controls

}
public static void main(String args[])
{
//Creating the JFrame object
JFrame frame = new JFrame("Applicant Details");
//making the frame visible
Applicant appObject;
appObject = new Applicant();
frame.setVisible(true);
frame.setSize(300,300);
}
...全文
378 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
yangFrame 2003-10-10
  • 打赏
  • 举报
回复

import javax.swing.*;

public class Applicant
{ //Variable for frame window
//main is static,it will call this
public static void main(String args[])
{
//Creating the JFrame object
ApplicantFrame frame = new ApplicantFrame();
//making the frame visible
frame.setVisible(true);
frame.setSize(300,300);
frame.setTitle("Applicant Details");
}
}

class ApplicantFrame extends JFrame
{
JPanel panel;
//variables of labels
JLabel labelAppID;
JLabel labelAppName;
JLabel labelAppAddress;
JLabel labelAppPosition;

//variables for data entry controls
JTextField textAppID;
JTextField textAppName;
JTextField textAppAddress;
JComboBox comboAppPosition;

public ApplicantFrame()
{
//Create a panel
panel = new JPanel();

labelAppID = new JLabel("Applicant ID");
labelAppName = new JLabel("Name");
labelAppAddress = new JLabel("Address");
labelAppPosition = new JLabel("Position");

//Initializing JTextField
textAppID = new JTextField(5);
textAppName = new JTextField(30);
textAppAddress = new JTextField(30);

String []C ={"China","india","English","American"};
JList l=new JList (C);
l.setSelectionMode(2);//0only single,1 continuous-shift key,2 any sequence- ctrl key

String position[] = { "Manager","Executive", "Associate"};
comboAppPosition = new JComboBox(position);


panel.add(labelAppID);
panel.add(textAppID);

//Adding controls for Applicant name
panel.add(labelAppName);
panel.add(textAppName);
//Adding controls for Applicant Address
panel.add(labelAppAddress);
panel.add(textAppAddress);

//Adding controls for Applicant Position
panel.add(labelAppPosition);
panel.add(comboAppPosition);
panel.add(l);
getContentPane().add(panel);
//Create a panel
}
}
Yanbin_Q 2003-10-10
  • 打赏
  • 举报
回复
注意你的frame的作用域是全局还是某个局部。
你的frame是在main()方法里申明的,不能在main()方法引用

你应该申明为类的全局对象。
xinuaile 2003-10-10
  • 打赏
  • 举报
回复
xinuaile 2003-10-10
  • 打赏
  • 举报
回复
getContentPane().add(panel);或add(panel); 都不行


cannot resolve symbol
symbol : method getContentPane ()
location: class Applicant
getContentPane().add(panel);

===========全部代码

import javax.swing.*;
public class Applicant
{ //Variable for frame window
//main is static,it will call this
JPanel panel;

//variables of labels
JLabel labelAppID;
JLabel labelAppName;
JLabel labelAppAddress;
JLabel labelAppPosition;

//variables for data entry controls
JTextField textAppID;
JTextField textAppName;
JTextField textAppAddress;
JComboBox comboAppPosition;

public Applicant()
{ //Create a panel
panel = new JPanel();

labelAppID = new JLabel("Applicant ID");
labelAppName = new JLabel("Name");
labelAppAddress = new JLabel("Address");
labelAppPosition = new JLabel("Position");

//Initializing JTextField
textAppID = new JTextField(5);
textAppName = new JTextField(30);
textAppAddress = new JTextField(30);

String []C ={"China","india","English","American"};
JList l=new JList (C);
l.setSelectionMode(2);//0only single,1 continuous-shift key,2 any sequence- ctrl key

String position[] = { "Manager","Executive", "Associate"};
comboAppPosition = new JComboBox(position);


panel.add(labelAppID);
panel.add(textAppID);

//Adding controls for Applicant name
panel.add(labelAppName);
panel.add(textAppName);
//Adding controls for Applicant Address
panel.add(labelAppAddress);
panel.add(textAppAddress);

//Adding controls for Applicant Position
panel.add(labelAppPosition);
panel.add(comboAppPosition);
panel.add(l);
add(panel);
//Create a panel


//Create and add the appropriate controls

}
public static void main(String args[])
{
//Creating the JFrame object
JFrame frame = new JFrame("Applicant Details");
//making the frame visible
Applicant appObject;
appObject = new Applicant();
frame.setVisible(true);
frame.setSize(300,300);
}

}
207 2003-10-10
  • 打赏
  • 举报
回复
如果不行去掉frame,即getContentPane().add(panel);或add(panel);
207 2003-10-10
  • 打赏
  • 举报
回复
..........


Panel panel=new Panel();
panel.add(labelAppID);
panel.add(textAppID);

//Adding controls for Applicant name
panel.add(labelAppName);
panel.add(textAppName);
//Adding controls for Applicant Address
panel.add(labelAppAddress);
panel.add(textAppAddress);

//Adding controls for Applicant Position
panel.add(labelAppPosition);
panel.add(comboAppPosition);
panel.add(l);
frame.getContentPane().add(panel);
图书馆图书管理系统 主窗口: import java.awt.*; import java.awt.event.*; import javax.swing.*; import myClass.swing.*; public class MainWindow extends JFrame implements ActionListener { JPanel panel1;//panel2; Container c; JMenuBar MenuB; JMenu SystemMenu,BookMGRMenu,BorrowBookMenu,ReturnBookMenu, InfoBrowseMenu,UserMGRMenu; JMenuItem UserLoginMenuItem,UserAddMenuItem,UserModifyMenuItem, UserDeleteMenuItem,ExitMenuItem,BookAddMenuItem,BookModifyMenuItem,BookDeleteMenuItem, BorrowBookMenuItem,BorrowInfoMenuItem,ReturnBookMenuItem,ReturnInfoMenuItem, BookListMenuItem,BorrowBookListMenuItem,UserListMenuItem; JLabel titleLabel,AuthorLabel,DateLabel; public MainWindow() { super("图书馆管理系统"); //--系统管理菜单-- MenuB=new JMenuBar(); SystemMenu=new JMenu("系统管理"); UserMGRMenu=new JMenu("用户管理"); UserLoginMenuItem=new JMenuItem("用户登录"); UserAddMenuItem=new JMenuItem("添加用户"); UserModifyMenuItem=new JMenuItem("修改用户"); UserDeleteMenuItem=new JMenuItem("删除用户"); ExitMenuItem=new JMenuItem("退出"); SystemMenu.add(UserLoginMenuItem); UserMGRMenu.add(UserAddMenuItem); UserMGRMenu.add(UserModifyMenuItem); UserMGRMenu.add(UserDeleteMenuItem); SystemMenu.add(UserMGRMenu); SystemMenu.add(ExitMenuItem); UserLoginMenuItem.addActionListener(this); UserAddMenuItem.addActionListener(this); UserModifyMenuItem.addActionListener(this); UserDeleteMenuItem.addActionListener(this); ExitMenuItem.addActionListener(this); MenuB.add(SystemMenu); //---书籍管理菜单-- BookMGRMenu=new JMenu("书籍管理"); BookAddMenuItem=new JMenuItem("添加书籍"); BookModifyMenuItem=new JMenuItem("修改书籍"); BookDeleteMenuItem=new JMenuItem("删除书籍"); BookMGRMenu.add(BookAddMenuItem); BookMGRMenu.add(BookModifyMenuItem); BookMGRMenu.add(BookDeleteMenuItem); BookAddMenuItem.addActionListener(this); BookModifyMenuItem.addActionListener(this); BookDeleteMenuItem.addActionListener(this); MenuB.add(BookMGRMenu); //--借书管理菜单-- BorrowBookMenu=new JMenu("借书管理"); BorrowBookMenuItem=new JMenuItem("书籍出借"); BorrowInfoMenuItem=new JMenuItem("出借信息修改"); BorrowBookMenu.add(BorrowBookMenuItem); BorrowBookMenu.add(BorrowInfoMenuItem); BorrowBookMenuItem.addActionListener(this); BorrowInfoMenuItem.addActionListener(this); MenuB.add(BorrowBookMenu); //--还书管理菜单-- ReturnBookMenu=new JMenu("还书管理"); ReturnBookMenuItem=new JMenuItem("书籍还入"); ReturnInfoMenuItem=new JMenuItem("书籍还入信息修改"); ReturnBookMenu.add(ReturnBookMenuItem); ReturnBookMenu.add(ReturnInfoMenuItem); ReturnBookMenuItem.addActionListener(this); ReturnInfoMenuItem.addActionListener(this); MenuB.add(ReturnBookMenu); //--信息一览菜单-- InfoBrowseMenu=new JMenu("信息一览"); BookListMenuItem=new JMenuItem("书籍列表"); BorrowBookListMenuItem=new JMenuItem("借阅情况表"); UserListMenuItem=new JMenuItem("用户列表"); InfoBrowseMenu.add(BookListMenuItem); InfoBrowseMenu.add(BorrowBookListMenuItem); InfoBrowseMenu.add(UserListMenuItem); BookListMenuItem.addActionListener(this); BorrowBookListMenuItem.addActionListener(this); UserListMenuItem.addActionListener(this); MenuB.add(InfoBrowseMenu); //---------------------------------- setJMenuBar(MenuB); //titleLabel=new JLabel("欢迎使用图书管理系统",JLabel.CENTER); //titleLabel.setFont(new Font("TimesRoman",Font.BOLD,24)); //AuthorLabel=new JLabel("作者:麦密辉",JLabel.RIGHT); //DateLabel=new JLabel("完成时间:04-11-04",JLabel.RIGHT); titleLabel=new JLabel(new ImageIcon(".\\pic.jpg")); c=getContentPane(); c.setLayout(new BorderLayout()); panel1=new JPanel(); panel1.setLayout(new BorderLayout()); //panel2=new JPanel(); //panel2.setLayout(new BorderLayout()); panel1.add(titleLabel,BorderLayout.CENTER); //panel2.add(AuthorLabel,BorderLayout.NORTH); //panel2.add(DateLabel,BorderLayout.SOUTH); c.add(panel1,BorderLayout.CENTER); //c.add(panel2,BorderLayout.SOUTH); setBounds(100,50,400,300); show(); //--设置初始功能:-- UserMGRMenu.setEnabled(false); BookMGRMenu.setEnabled(false); BorrowBookMenu.setEnabled(false); ReturnBookMenu.setEnabled(false); InfoBrowseMenu.setEnabled(false); } //--设置每个菜单点击后出现的窗口和窗口显示的位置-- public void actionPerformed(ActionEvent e) { if(e.getActionCommand()=="用户登录") { UserLogin UserLoginFrame=new UserLogin(this); Dimension FrameSize=UserLoginFrame.getPreferredSize(); Dimension MainFrameSize=getSize(); Point loc=getLocation(); UserLoginFrame.setLocation((MainFrameSize.width-FrameSize.width)/2+loc.x, (MainFrameSize.height-FrameSize.height)/2+loc.y); UserLoginFrame.pack(); UserLoginFrame.show(); } else if(e.getActionCommand()=="添加用户") { UserAdd UserAddFrame=new UserAdd(); Dimension FrameSize=UserAddFrame.getPreferredSize(); Dimension MainFrameSize=getSize(); Point loc=getLocation(); UserAddFrame.setLocation((MainFrameSize.width-FrameSize.width)/2+loc.x, (MainFrameSize.height-FrameSize.height)/2+loc.y); UserAddFrame.pack(); UserAddFrame.show(); } else if(e.getActionCommand()=="修改用户") { UserModify UserModifyFrame=new UserModify(); Dimension FrameSize=UserModifyFrame.getPreferredSize(); Dimension MainFrameSize=getSize(); Point loc=getLocation(); UserModifyFrame.setLocation((MainFrameSize.width-FrameSize.width)/2+loc.x, (MainFrameSize.height-FrameSize.height)/2+loc.y); UserModifyFrame.pack(); UserModifyFrame.show(); } else if(e.getActionCommand()=="删除用户") { UserDelete UserDeleteFrame=new UserDelete(); Dimension FrameSize=UserDeleteFrame.getPreferredSize(); Dimension MainFrameSize=getSize(); Point loc=getLocation(); UserDeleteFrame.setLocation((MainFrameSize.width-FrameSize.width)/2+loc.x, (MainFrameSize.height-FrameSize.height)/2+loc.y); UserDeleteFrame.pack(); UserDeleteFrame.show(); } else if(e.getActionCommand()=="添加书籍") { BookAdd BookAddFrame=new BookAdd(); Dimension FrameSize=BookAddFrame.getPreferredSize(); Dimension MainFrameSize=getSize(); Point loc=getLocation(); BookAddFrame.setLocation((MainFrameSize.width-FrameSize.width)/2+loc.x, (MainFrameSize.height-FrameSize.height)/2+loc.y); BookAddFrame.pack(); BookAddFrame.show(); } else if(e.getActionCommand()=="修改书籍") { BookModify BookModifyFrame=new BookModify(); Dimension FrameSize=BookModifyFrame.getPreferredSize(); Dimension MainFrameSize=getSize(); Point loc=getLocation(); BookModifyFrame.setLocation((MainFrameSize.width-FrameSize.width)/2+loc.x, (MainFrameSize.height-FrameSize.height)/2+loc.y); BookModifyFrame.pack(); BookModifyFrame.show(); } else if(e.getActionCommand()=="删除书籍") { BookDelete BookDeleteFrame=new BookDelete(); Dimension FrameSize=BookDeleteFrame.getPreferredSize(); Dimension MainFrameSize=getSize(); Point loc=getLocation(); BookDeleteFrame.setLocation((MainFrameSize.width-FrameSize.width)/2+loc.x, (MainFrameSize.height-FrameSize.height)/2+loc.y); BookDeleteFrame.pack(); BookDeleteFrame.show(); } else if(e.getActionCommand()=="书籍出借") { BorrowBook BorrowBookFrame=new BorrowBook(); Dimension FrameSize=BorrowBookFrame.getPreferredSize(); Dimension MainFrameSize=getSize(); Point loc=getLocation(); BorrowBookFrame.setLocation((MainFrameSize.width-FrameSize.width)/2+loc.x, (MainFrameSize.height-FrameSize.height)/2+loc.y); BorrowBookFrame.pack(); BorrowBookFrame.show(); } else if(e.getActionCommand()=="出借信息修改") { BorrowInfo BorrowInfoFrame=new BorrowInfo(); Dimension FrameSize=BorrowInfoFrame.getPreferredSize(); Dimension MainFrameSize=getSize(); Point loc=getLocation(); BorrowInfoFrame.setLocation((MainFrameSize.width-FrameSize.width)/2+loc.x, (MainFrameSize.height-FrameSize.height)/2+loc.y); BorrowInfoFrame.pack(); BorrowInfoFrame.show(); } else if(e.getActionCommand()=="书籍还入") { ReturnBook ReturnBookFrame=new ReturnBook(); Dimension FrameSize=ReturnBookFrame.getPreferredSize(); Dimension MainFrameSize=getSize(); Point loc=getLocation(); ReturnBookFrame.setLocation((MainFrameSize.width-FrameSize.width)/2+loc.x, (MainFrameSize.height-FrameSize.height)/2+loc.y); ReturnBookFrame.pack(); ReturnBookFrame.show(); } else if(e.getActionCommand()=="书籍还入信息修改") { ReturnInfo ReturnInfoFrame=new ReturnInfo(); Dimension FrameSize=ReturnInfoFrame.getPreferredSize(); Dimension MainFrameSize=getSize(); Point loc=getLocation(); ReturnInfoFrame.setLocation((MainFrameSize.width-FrameSize.width)/2+loc.x, (MainFrameSize.height-FrameSize.height)/2+loc.y); ReturnInfoFrame.pack(); ReturnInfoFrame.show(); } else if(e.getActionCommand()=="书籍列表") { BookList BookListFrame=new BookList(); Dimension FrameSize=BookListFrame.getPreferredSize(); Dimension MainFrameSize=getSize(); Point loc=getLocation(); BookListFrame.setLocation((MainFrameSize.width-FrameSize.width)/2+loc.x, (MainFrameSize.height-FrameSize.height)/2+loc.y); BookListFrame.pack(); BookListFrame.show(); } else if(e.getActionCommand()=="借阅情况表") { BorrowBookList BorrowBookListFrame=new BorrowBookList(); Dimension FrameSize=BorrowBookListFrame.getPreferredSize(); Dimension MainFrameSize=getSize(); Point loc=getLocation(); BorrowBookListFrame.setLocation((MainFrameSize.width-FrameSize.width)/2+loc.x, (MainFrameSize.height-FrameSize.height)/2+loc.y); BorrowBookListFrame.pack(); BorrowBookListFrame.show(); } else if(e.getActionCommand()=="用户列表") { UserList UserListFrame=new UserList(); Dimension FrameSize=UserListFrame.getPreferredSize(); Dimension MainFrameSize=getSize(); Point loc=getLocation(); UserListFrame.setLocation((MainFrameSize.width-FrameSize.width)/2+loc.x, (MainFrameSize.height-FrameSize.height)/2+loc.y); UserListFrame.pack(); UserListFrame.show(); } else if(e.getActionCommand()=="退出") { this.dispose(); System.exit(0); } } //--设置登录用户的权限-- public void setEnable(String powerType) { if(powerType.trim().equals("系统管理员")) { UserMGRMenu.setEnabled(true); BookMGRMenu.setEnabled(true); BorrowBookMenu.setEnabled(true); ReturnBookMenu.setEnabled(true); InfoBrowseMenu.setEnabled(true); UserListMenuItem.setEnabled(true); } else if(powerType.trim().equals("书籍管理员")) { UserMGRMenu.setEnabled(false); BookMGRMenu.setEnabled(true); BorrowBookMenu.setEnabled(false); ReturnBookMenu.setEnabled(false); InfoBrowseMenu.setEnabled(true); UserListMenuItem.setEnabled(false); } else if(powerType.trim().equals("借阅管理员")) { UserMGRMenu.setEnabled(false); BookMGRMenu.setEnabled(false); BorrowBookMenu.setEnabled(true); ReturnBookMenu.setEnabled(true); InfoBrowseMenu.setEnabled(true); UserListMenuItem.setEnabled(false); } else if(powerType.trim().equals("else")) { UserMGRMenu.setEnabled(false); BookMGRMenu.setEnabled(false); BorrowBookMenu.setEnabled(false); ReturnBookMenu.setEnabled(false); InfoBrowseMenu.setEnabled(false); } } public static void main(String args[]) { MainWindow mainFrame=new MainWindow(); mainFrame.addWindowListener(new MyWindowListener()); } }
java编写的计算器,能实现加减乘除。 //***该梦幻计算器与Windows附件自带计算器的标准版功能、界面相仿***// //******但还不支持键盘操作,如有需要,下一次等级将满足你**********// import java.awt.*; import java.lang.*; import javax.swing.*; import javax.swing.event.*; import java.awt.event.*; import java.awt.Component.*; import java.awt.color.*; import java.text.DecimalFormat; //*****************************************************************************// //*****************************************************************************// public class Calculator implements ActionListener //导入动作监听接口 { //******************************// //*****设计计算器界面的单位*****// JFrame frame; //定义框架 JTextField textAnswer; //定义输出显示框 JPanel panel, panel1, panel2, panel3;//定义面板作为子容器,从而达到要求的界面效果 JMenuBar mainMenu; JTextField textMemory; JLabel labelMemSpace; //labelMemSpace单纯做摆设,控制面板的形状 JButton buttonBk, buttonCe, buttonC; JButton button[]; JButton buttonMC, buttonMR, buttonMS, buttonMAdd; JButton buttonDot, buttonAddAndSub, buttonAdd, buttonSub, buttonMul,buttonDiv, buttonMod; JButton buttonSqrt, buttonDao, buttonEqual; JMenu editMenu, viewMenu, helpMenu; JMenuItem copyItem, pasteItem, tItem, sItem, numberGroup, topHelp, aboutCal,myCollege; DecimalFormat df; //设置数据输出精度 boolean clickable; //控制当前能否按键 double memoryd; //使用内存中存储的数字 int memoryi; double vard, answerd; //用来保存double型数据的中间值(vard)和最后结果(answerd) short key = -1, prekey = -1; //key用来保存当前进行何种运算,prekey用来保存前次进行何种运算 boolean clear = false; String copy; //做复制用 JTextArea help; //帮助 JScrollPane scrollHelp; static boolean One =true; //******************// //*****构造函数开始*****// public Calculator() { clickable = true; answerd = 0; frame = new JFrame("梦幻计算器--SWE08008"); frame.setResizable(false);//不允许改变计算器的大小 frame.setLocation(250,150);//设置计算器的起始位置 frame.setBackground(Color.YELLOW); df = new DecimalFormat("0.##############"); //设置数据输出精度(对于double型值)
课程设计说明书 一、 课程设计目的 1 通过实际的编程与学习,了解自己的学习情况和实际动手能力; 2 通过编程发现问题与解决问题,提高自己解决问题的能力; 3 通过编程熟悉 java 的编程过程和软件的使用技巧。 二、 设计内容 1 设计计算器的框架与组件; 2 向面板上添加按钮与组件并给每个面板添加事件; 3 设计事件的响应,实现计算功能。 三、要求分析 1 需求1; 2 需求2; 3 需求3。 四、概要设计(功能设计) 用户随意进行加、减、乘、除、平方、开跟等操作,方便快捷的实现运算功能, 方便用户进行准确无误的运算。 设计思路:向 Frame 中添加容器,在 north 中添加文本框,center 中添加面板, 面板设为 gridlayout 布局,然后添加按纽,设置监听器,设置事件和响应。 五、程序源代码(详细设计) import java.awt.*; import java.awt.event.*;//引入事件包 import javax.swing.*; import java.lang.Math;//引入 Math 包,进行数学运算 public class Calculator implements ActionListener,WindowListener { private JFrame f=new JFrame("计算器"); JTextField tf=new JTextField(10); String m; char sign;//判断符号:+、-、×、/ Double a,b,c;//a 为第一个运算数,b 为第二个运算数,c 为输出数 Panel pa;//定义面板 Button bqingkong;//定义按钮 Button btuige; Button bkaigen; Button bpingfang; Button b1; Button b2; Button b3; Button bcheng; Button b4; Button b5; Button b6; Button bchu; Button b7; Button b8; Button b9; Button bjian; Button b0; Button bpoint; Button bjia; Button bdengyv; public void creat()//建立计算器面板 { f.setSize(200,300); f.setVisible(true); tf.setEditable(false); tf.setHorizontalAlignment(JTextField.RIGHT); Container c= f.getContentPane();//设置容器 c.add(BorderLayout.NORTH,tf); Panel p=new Panel(); c.add(BorderLayout.CENTER,p); GridLayout g=new GridLayout(5,4); p.setLayout(g); bqingkong=new Button("C"); //分别添加按钮和事件 bqingkong.addActionListener(this); p.add(bqingkong); btuige=new Button("back"); btuige.addActionListener(this); p.add(btuige); bkaigen=new Button(" "); bkaigen.addActionListener(this); p.add(bkaigen); bpingfang=new Button("^2"); bpingfang.addActionListener(this); p.add(bpingfang); b1=new Button("1"); b1.addActionListener(this); p.add(b1); b2=new Button("2"); b2.addActionListener(this); p.add(b2); b3=new Button("3"); b3.addActionListener(this); p.add(b3); bcheng=new Button("*"); bcheng.addActionListener(this); p.add(bcheng); b4=new Button("4"); b4.addActionListener(this); p.add(b4); b5=new Button("5"); b5.addActionListener(this); p.add(b5); b6=new Button("6"); b6.

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧