import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class tijiao_ui extends JFrame {
public tijiao_ui(){
JFrame frame = new JFrame("验收申请"); //创建窗口,并设置标题为
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //当关闭窗口时,退出整个程序
frame.setBounds(500,100,600,600);
JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 50)); //创建容器,并使用 FlowLayout 布局管理器
frame.setContentPane(panel); //把 panel 这个容器设置为 frame 窗口的内容面板
JLabel text1 = new JLabel("学生姓名");
JLabel text2 = new JLabel("验收教师姓名");
JLabel text3 = new JLabel("标题");
JLabel text4 = new JLabel("内容");
JLabel text5 = new JLabel("验收时间");
JButton button = new JButton("提交");
text1.setBounds(50,50,50,50);
text2.setBounds(50,100,50,50);
text3.setBounds(50,150,50,50);
text4.setBounds(50,200,50,50);
text5.setBounds(50,250,50,50);
panel.add(button);
panel.add(text1);
panel.add(text2);
panel.add(text3);
panel.add(text4);
panel.add(text5);
MyActionListener listener = new MyActionListener();
button.addActionListener(listener);
frame.setVisible(true);
}
给文本设置的参数不生效,如何修改