首页 > 试题广场 >

图形用户界面程序填空。界面效果:姓名、学号两个标签之后两个文

[填空题]

图形用户界面程序填空。界面效果:姓名、学号两个标签之后两个文本行。在文本行填入姓名和学号后,单击按钮“提交”,学号从上往下掉,姓名从左往右移动。注意有的空需将不完整的 Java 保留字补齐

import java.applet.Applet;

import java.awt.1; //(1)

import java.awt.event.2; //(2)

public class NameDrop extends Applet implements 3,ActionListener{ //(3)

private int x =0;

private int y =0;

private Thread 4 ; //(4)

private boolean b = false ;

private Button button ;

private TextField textFieldName ;

private TextField textFieldID ;

private String name ;

private String ID ;

private Label LabelName ;

private Label LabelID ;

public void init( ){

this.setSize(300,300);

button = new Button( " 提交 " );

textFieldName = new TextField(10);

textFieldID = new TextField(10);

button .addActionListener( 5 ); //(5)

LabelName = new Label( " 姓名 " );

LabelID = new Label( " 学号 " );

this.add( button );

this.add( LabelName );

this.add( textFieldName );

this.add( LabelID );

this.add( textFieldID );

}

public void 6{ //(6)

if ( t == null ){

t = new 7( this ); //(7)

t .start( );

}

}

public void stop( ){

if ( t != null ){

t .interrupt( );

t = null ;

}

}

public void paint(8 g){ //(8)

if ( b ){

x = x +1;

y = y +1;

g.drawString( name , x ,80);

g.drawString( ID ,50, y );

}

}

public void run( ) {

while ( t != null ){

9( ); //(9)

try {

t .10(20); //(10)

} catch (InterruptedException e){

11 ; //(11)

}

}

}

public void actionPerformed(ActionEvent e) {

if (e.12 == button ){ //(12)

b = true ;

name = textFieldName . 13( ); //(13)

ID = textFieldID . getText( );

}

}
对不起,这题目我屏蔽了,不会有人想写吧??
发表于 2017-05-16 22:56:55 回复(3)
更多回答
这题我不相信会有人去做
发表于 2017-05-17 20:59:25 回复(0)
我就不相信会有人去做这题 !
发表于 2017-05-26 10:21:46 回复(0)
要骂人了
发表于 2017-05-25 12:37:18 回复(0)

差距。。。。。。。。。。。。。。。。。。。。。。
发表于 2017-07-13 16:21:59 回复(0)
做了半个小时,就做出了六个完全正确的,感觉信息量太多了,我晕啊。
发表于 2017-07-05 09:09:29 回复(0)
没看一眼直接略过的给个大大的赞吧
发表于 2017-05-19 11:23:35 回复(0)
这题我选择放弃
发表于 2017-05-17 14:46:44 回复(0)
同道中人都在啊,哈哈
发表于 2017-07-10 12:36:14 回复(0)
只填了两个*,然后放弃
发表于 2017-06-28 19:30:22 回复(0)
我不做了!!!!
发表于 2017-06-24 17:02:48 回复(0)

来来来,做对的人说说。。。。

发表于 2017-06-20 19:26:03 回复(0)
来来来,这道题谁做了?
发表于 2017-06-16 09:10:40 回复(0)
这题我不相信会有人去做 (不好意思做了一半 坚持不下去了)
发表于 2017-06-10 13:02:22 回复(0)
屏蔽了,实在是太长了,没人做吧,就算做了这种填空题的答案,你写对了都不一定对
编辑于 2017-06-04 10:52:38 回复(0)
这种题牛客是怎么想的
发表于 2017-05-20 10:59:41 回复(0)
直接没做了…
发表于 2017-05-17 08:58:15 回复(1)