题目内容

本程序的功能是获取文本框中的文本。窗口中有两个文本框“用户名”和“密码”,以及三个按钮“登录”、“其他用户登录”和“关闭”,初始状态“用户名”文本框是只读的,单击“其他用户登录”按钮后变成可写的,“密码”文本框使用的不是密码文本框,在用户键入的时候没置显示为*号。输入用户名和密码后,单击“登录”按钮后,如果输入的密码为空,则弹出提示消息框,否则后台将显示输入的用户名和密码。比如,显示为“admin用户的密码:password”(admin为输入的用户名,password为输入密码)。 import java.awt.*; import java.awt.event.*; import javax.swing.JOptionPane; public class java3 public static void main(String args[]) final Frame frmFrame=new Frame(); Panel pnlPanel=new Panel(); Lrabel lblUsername=new Label("用户名"); Label lblPassword=new Label("密码"); final TextField txtUsername=new TextField("Student") final TextField txtPassword=new TextField("",8); txtUsername.setEditable(false); txtPassWOrd.setChar(’*’); Button btnButtonl=new Button("登录"); Button btnButton2=new Button("其他用户登录"); Button btnButton3=new Button("关闭"); btnButtonl.addActionListener(new ActionListen-er() public void actionPerformed(ActionEvent e) if((txtPassword.getText()).length()==0) JOptionPane.showMessageDialog(frmFrame,"密码不能为空"); return; txtPassword.setColumns(16); System.out.println(txtUsername.getText()+"用户的密码:" +txtPassword.getPassword()); ); btnButton2.addActionListener(new ActionListen-er() public void actionPerformed(ActionEvent e) txtUsername.setEnable(true); ); btnButton3.addActionListener(new ActionListen-er() public void actionPerformed(ActionEvent e) System.exit(0); ); pnlPanel.add(1blUsername); pnlPanel.add(txlUsername); pnlPanel.add(1blPassword); pnlPanel.add(txtPassword); pnlPanel.add(btnButtonl); pnlPanel.add(btnButton2); pnlPanel.add(btnButton3); frmFrame.add(pnlPanel); frmFrame.setTitle("advance"); frmFrame.pack(); frmFrame.show();

查看答案
更多问题

Walking is the earliest and simplest from exercises. By putting one foot in front of other, you can start to walk your ways towards a healthier life-style. Walking is an easy way to challenge the cardiovascular system (心血管系统),while at the same time building muscles. But to achieve these goals, a little more than a gentle walk around the block is required. Walking actually burns as many calories (卡路里) as running the same distance - if done in the correct manner and at a reasonable pace (步伐). Start with a basic program that you can complete three or four times a week. This should include five main steps: -A beginning warm-up for about 5 minutes. -A little bit faster period of 5 minutes at medium level (中等速度). -A 10 minutes "burning" at a higher level. -A 5 minutes slow down period at a medium level. -A 5 minutes cool down period at a low level again. -A suitable walking pace of around 5 kilometers per hour will burn around 80 calories in 30 minutes. In the first 5 minutes of walking, you should walk

A. quickly
B. slowly
C. at top speed
D. at medium pace

请简述叶克斯—多德森定律的主要内容。

Walking is the earliest and simplest from exercises. By putting one foot in front of other, you can start to walk your ways towards a healthier life-style. Walking is an easy way to challenge the cardiovascular system (心血管系统),while at the same time building muscles. But to achieve these goals, a little more than a gentle walk around the block is required. Walking actually burns as many calories (卡路里) as running the same distance - if done in the correct manner and at a reasonable pace (步伐). Start with a basic program that you can complete three or four times a week. This should include five main steps: -A beginning warm-up for about 5 minutes. -A little bit faster period of 5 minutes at medium level (中等速度). -A 10 minutes "burning" at a higher level. -A 5 minutes slow down period at a medium level. -A 5 minutes cool down period at a low level again. -A suitable walking pace of around 5 kilometers per hour will burn around 80 calories in 30 minutes. According to the passage, walking is a simple way to

A. lose weight
B. avoid heart attacks
C. cure blood diseases
D. strengthen heart function

Bob and Annie had not known each other long before they became eager to get married: Bob because he wanted Annie and she ( though she was fond of Bob in her own way) because she could at least lead a life away from her family. When Mrs. Thompson suggested that they marry and live with her in Dover Street until they could get a house of their own, Annie hesitated. Her idea of marriage had been something which brought her a husband and an orderly, well-furnished home all at once. But she soon saw the advantages of this arrangement. She would, first of all, escape from her present life into a house which was quiet and efficiently run, not like her own; and she would be able to go on working so that she and Bob could save up all money more quickly for their own house. She would also get Bob, a good enough husband for any working-class girl: good-natured and ready to be bent to her way whenever it was necessary for her ends. Things went well until her mother-in-law’ s death, when Annie had to give up her job and was at home all day. Her father-in-law became just a silent figure in the house and al though Bob became used to him, Annie began to find the old man’ s constant presence in the house a source of growing annoyance. "He gets on my nerves, Bob, "she said one night when they were alone. "Just sitting there all day and I have to clean up around him. And he hardly says a word from getting up in the morning to going to bed." "Well, I suppose he has the right to do as he likes, "Bob said mildly. "It’ s his house not ours. We’ re the lodgers(寄宿者), if anybody. "But to Annie, now looking after the house as if it were her own, it was beginning to seem the other way about. Annie wanted to get married because she ______.

A. had known Bob for a long time
B. wanted to leave home
C. was madly in love with Bob
D. had led a lonely life

答案查题题库