文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > 资格考试/认证 > IT认证 > 全国计算机等级考试二级Java上机真题南开一百题
侵权投诉

全国计算机等级考试二级Java上机真题南开一百题

public Java_3()

{

//*********Found********

______( "示范异常" );

Container c = getContentPane();

c.setLayout( new GridLayout( 3, 2 ) );

c.add( new JLabel( "输入分子",

SwingConstants.RIGHT ) );

input1 = new JTextField( 10 );

c.add( input1 );

c.add(

new JLabel( "输入分母和回车",

SwingConstants.RIGHT ) );

input2 = new JTextField( 10 );

c.add( input2 );

input2.addActionListener( this );

c.add( new JLabel( "计算结果", SwingConstants.RIGHT ) );

output = new JTextField();

c.add( output );

setSize( 425, 100 );

show();

}

//处理 GUI 事件

public void actionPerformed( ActionEvent e ){

DecimalFormat precision3 = new DecimalFormat( "0.000" );

output.setText( "" ); // 空的JTextField输出

//*********Found********

___________ {

number1 = Integer.parseInt( input1.getText() );

number2 = Integer.parseInt( input2.getText() );

result = quotient( number1, number2 );

//*********Found********

output.setText(_______________________________);

}

catch ( NumberFormatException {

JOptionPane.showMessageDialog( this,

"你必须输入两个整数",

"非法数字格式",

JOptionPane.ERROR_MESSAGE );

}

catch ( Exception dbze ) {

//*********Found********

_______________________________( this,

上一页第17页

你可能喜欢

  • 考试二级JAVA真题及答案
  • 模电期末考试试题及答案
  • 全国计算机等级考试二级c++题库
  • 全国计算机等级考试二级C++

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email