⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 urlcheckconfigframe.java

📁 真正的网络爬虫的源代码啊,希望大家好好阅读,写出心得体会啊
💻 JAVA
字号:
package net.matuschek.jobo;

import java.util.Vector;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;

import net.matuschek.spider.RegExpURLCheck;
import net.matuschek.swing.JHideFrame;
import net.matuschek.swing.OptionPanel;
/*********************************************
    Copyright (c) 2001 by Daniel Matuschek
*********************************************/




/**
 * Swing Configuration frame for the RegExpURLCheck rules
 *   
 * @author Daniel Matuschek
 * @version $Id $
 */
public class URLCheckConfigFrame extends JHideFrame {

	private static final long serialVersionUID = 7588707167267231914L;

public URLCheckConfigFrame(RegExpURLCheck check) {    
    super("URLCheck configuration");
    this.check = check;
    initComponents();
  }


  protected void initComponents() {
    JPanel mainPanel = new JPanel();
    mainPanel.setLayout(new BoxLayout(mainPanel,BoxLayout.Y_AXIS));
    setContentPane(mainPanel);

    OptionPanel dialogPanel = new OptionPanel(2);

    JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new BoxLayout(buttonPanel,BoxLayout.X_AXIS));

    mainPanel.add(dialogPanel);
    mainPanel.add(buttonPanel);

    /**
       Input fields
     **/

    // table
    Vector rules = check.getRules();
    RegExpRuleTableModel tableModel 
      = new RegExpRuleTableModel(check.getRules());
    JTable table = new JTable(tableModel);
    JScrollPane scrollPane = new JScrollPane(table);
    dialogPanel.add(scrollPane);


    /**
       End of input fields
     **/

    /**
       Button panel
     **/
    JButton okButton = new JButton();
    okButton.setText("OK");
    okButton.addActionListener(new java.awt.event.ActionListener() {
	public void actionPerformed(java.awt.event.ActionEvent evt) {
	  updateAndHide();
	}
      });
    buttonPanel.add(okButton);

    JButton closeButton = new JButton();
    closeButton.setText("Cancel");
    closeButton.addActionListener(new java.awt.event.ActionListener() {
	public void actionPerformed(java.awt.event.ActionEvent evt) {
	  exitForm();
	}
      });
    buttonPanel.add(closeButton);

    /**
       End of button panel 
    **/

    pack ();
    updateFormFromURLCheck();
  }


  /**
     update the RegExpURLCheck form dialog
  **/
  protected void updateAndHide() {
    this.setVisible(false);
  }


  /** 
      update the content of the form field from the current robot
      settings
  **/
  protected void updateFormFromURLCheck() {
  }


  /**
     update the URLCheck settings from the current fields
     @return true if everything is okay, false otherwise
  **/
  protected boolean updateURLCheckFromForm() {
    return true;
  }

  /**********************************************************************/
  /**********************************************************************/
  /**********************************************************************/

  /** the RegExpURLCheck to configure **/
  RegExpURLCheck check = null;


  // input fields
  //

  
} // URLCheckConfigFrame

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -