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

📄 customerfindframe.java

📁 java在线商店的源代码。编写十分规范的哦
💻 JAVA
字号:
/**
 * Copyright (c) 1996-2004 Borland Software Corporation.  All Rights Reserved.
 * 
 * This SOURCE CODE FILE, which has been provided by Borland Software as part
 * of a Borland Software product for use ONLY by licensed users of the product,
 * includes CONFIDENTIAL and PROPRIETARY information of Borland Software.  
 *
 * USE OF THIS SOFTWARE IS GOVERNED BY THE TERMS AND CONDITIONS 
 * OF THE LICENSE STATEMENT AND LIMITED WARRANTY FURNISHED WITH
 * THE PRODUCT.
 *
 * IN PARTICULAR, YOU WILL INDEMNIFY AND HOLD BORLAND SOFTWARE, ITS
 * RELATED COMPANIES AND ITS SUPPLIERS, HARMLESS FROM AND AGAINST ANY
 * CLAIMS OR LIABILITIES ARISING OUT OF THE USE, REPRODUCTION, OR
 * DISTRIBUTION OF YOUR PROGRAMS, INCLUDING ANY CLAIMS OR LIABILITIES
 * ARISING OUT OF OR RESULTING FROM THE USE, MODIFICATION, OR
 * DISTRIBUTION OF PROGRAMS OR FILES CREATED FROM, BASED ON, AND/OR
 * DERIVED FROM THIS SOURCE CODE FILE.
 */
//------------------------------------------------------------------------------
// Copyright (c) 1996-2004 Borland Software Corporation.  All Rights Reserved.
//------------------------------------------------------------------------------

package com.borland.samples.orderentry;

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import com.borland.dbswing.*;
import com.borland.dx.sql.dataset.*;
import com.borland.dx.dataset.*;

/**
 * CustomerFindFrame is inherited from FindFrame which is the base form for
 * all Find windows in the Cliffhanger application.
 * This find forms allows users to lookup customers by searching on a value for
 * a single column in the customer dataset. A grid displays all the records
 * for the datasets, and the grid will try to find the closet
 * matching record as the user types in the search value.
 */
public class CustomerFindFrame extends FindFrame {
  private static DataModule1 dm = DataModule1.getDataModule();
  private static CustomerFindFrame myCustomerFindFrame;
  ResourceBundle res = Res.getBundle("com.borland.samples.orderentry.Res");

  /**
   * The constructor is public, but you should use the getCustomerFindFrame method
   * to get an instance of the class.
   */
  public CustomerFindFrame() {
    try {
      jbInit();   // initialize frame's controls (JBuilder designer)
    }
    catch (Exception e) {
      e.printStackTrace();
    }
  }

  private void jbInit() throws Exception{
    this.setTitle(res.getString("CFF_Find_Customer"));
    this.setDataSet(dm.getCustomerDataSet());
    this.setComboBoxItems(new String [] { res.getString("DM_CustomerDS_LASTNAME"), res.getString("DM_CustomerDS_FIRSTNAME"), res.getString("DM_CustomerDS_PHONE"), res.getString("DM_CustomerDS_ID") });
  }


  /**
   * Class method to access the singleton instance of the class.
   * @return CustomerFindFrame
   */
  public static CustomerFindFrame getCustomerFindFrame() {
    if (myCustomerFindFrame == null)
      myCustomerFindFrame = new CustomerFindFrame();

    return myCustomerFindFrame;
  }


  /**
   * When the Go To button is clicked, override this event handler
   * to show the appropriate form for the record selected, then
   * close this form.
   * @param e ActionEvent
   */
  protected void btnGoto_actionPerformed(ActionEvent e) {
    // Show the Customer form and show it centered in the screen
    JFrame frame = CustomerFrame.getCustomerFrame();
    CliffhangerApplication.showCenteredWindow(frame, false);

    // Hide this frame ...
    this.setVisible(false);
    this.dispose();
  }

}

⌨️ 快捷键说明

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