当前位置:百问九>百科知识>java代码

java代码

2023-07-24 09:56:31 编辑:zane 浏览量:620

java代码

帮你改了一激芦橘枣下:import java.awt.*; import java.awt.event.*;import javax.swing.*;public class logon extends JFrame {public static void main(String args[]) { logon a=new logon(); a.show(); } CheckboxGroup ShenFen=new CheckboxGroup(); Checkbox ShenFen1; Checkbox ShenFen2; Checkbox ShenFen3; JButton LogonButton,Exit; JTextField id; JPasswordField password;public logon(){ this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); this.setLayout(null); setTitle("学生选课系统"明伍带); setSize(600,600); ShenFen1=new Checkbox("学生",ShenFen,true); ShenFen2=new Checkbox("教师",ShenFen,false); ShenFen3=new Checkbox("管理员",ShenFen,false); add(ShenFen1); add(ShenFen2); add(ShenFen3); ShenFen1.setBounds(300, 350, 50, 50); ShenFen2.setBounds(350, 350, 50, 50); ShenFen3.setBounds(400, 350, 50, 50); LogonButton=new JButton("登录"); add(LogonButton); Exit=new JButton("退出"); add(Exit); Exit.setBounds(400, 400,60, 60); id=new JTextField(); add(id); id.setBounds(300, 200, 200, 30); password=new JPasswordField(); add(password); password.setBounds(300, 250, 200, 30); } }

版权声明:文章由 百问九 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.baiwen9.com/article/262067.html
热门文章
二维码