搜索引擎及搜索引擎优化(SEO)实验 - 图文(3)

2019-03-23 14:36

11

12

7. 选做:提供网络蜘蛛程序完整源代码及实际运行结果界面截屏(实验报告中需包含源代码和界面截屏)。

13

import javax.swing.*;

import java.awt.*;// need this to access the color object /*

* IntegerVerifier.java * */ /**

* Input Verifier to verifier integer text fields *

* Checks for valid integer input, and to see if the number is between a * specified max and min value. *

* @author Mark Pendergast */

public class IntegerVerifier extends javax.swing.InputVerifier { /** listener to get valid/invalid data reports */ private VerifierListener listener = null;

/** blank fields allowed, true for ok, false for error */

14

private boolean blankOk = false; /** minimum valid value */

int minValue = Integer.MIN_VALUE; /** maximum valid value*/

int maxValue = Integer.MAX_VALUE; /** Creates a new instance of IntegerVerifier *

* @param alistener VerifierListener to receive invalid/valid data class (null means no listener)

* @param blankok if true, then the field can be left blank * @param min minimum valid value * @param max maximum valid value */

public IntegerVerifier(VerifierListener alistener, boolean blankok, int min, int max) { listener = alistener; blankOk = blankok; minValue = min; maxValue = max; } /**

* Verifies contents of the specified component *

* @param jComponent the component to check * @return true if the component is ok, else false * */

public boolean verify(javax.swing.JComponent jComponent) { JTextField thefield = (JTextField)jComponent; String input = thefield.getText(); int number;

input = input.trim(); // strip off leading and trailing spaces as these gives Integer.parseInt problems

if(input.length() == 0 && blankOk) {

15


搜索引擎及搜索引擎优化(SEO)实验 - 图文(3).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:小学数学第12册第一单元测试题

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: