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

📄 borrowfram.java

📁 java+sql 图书管理系统
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
package MyLibraryok.borrow.jiemian;

import java.util.*;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
import MyLibraryok.borrow.ziliao.*;
import MyLibraryok.MyMain.MainFrame2;

/**
 * <p>Title: </p>
 * <p>Description:0824 史辰斌 </p>
 * <p>Copyright: Copyright (c) 2007</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class BorrowFram extends JDialog {
    Dimension screen = getToolkit().getScreenSize(); //得到屏幕尺寸

  int myWidth = screen.width;
  int myHeight = screen.height;
  int x = 616;
  int y = 410;



  public BorrowFram(MainFrame2 ss) {
      super(ss,"",true);
    try {
      jbInit();
    }
    catch (Exception ex) {
      ex.printStackTrace();
    }
  }
  JDatePicker n = new JDatePicker(JDatePicker.STYLE_CN_DATE, new Date());
   JDatePicker  n1 = new JDatePicker(JDatePicker.STYLE_CN_DATE, new Date());
  JDatePicker  n2 = new JDatePicker(JDatePicker.STYLE_CN_DATE, new Date());
  JDatePicker n3 = new JDatePicker(JDatePicker.STYLE_CN_DATE, new Date());
  Border border20;
  void jbInit() throws Exception {
          // Center the frame
       if (x >= myWidth || y >= myHeight) {
         x = myWidth;
         y = myHeight;
         this.setSize(x, y);
         this.setLocation(0, 0);
       } else {
         this.setSize(x, y);

         this.setLocation((myWidth - this.getSize().width) / 2,
                          (myHeight - this.getSize().height) / 2);
       }
       ////////////////// Center the frame


 ////////////////////////////////////////////////
    jTable1.getTableHeader().setReorderingAllowed(false);
    jTable2.getTableHeader().setReorderingAllowed(false);
////////////////////////////////////////////////
    border20 = BorderFactory.createLineBorder(SystemColor.control,2);
    jComboBox2.setBounds(new Rectangle(13, 11, 119, 24));
    getContentPane().setLayout(null);

    n.setBorder(BorderFactory.createEtchedBorder());
    n.setBounds(new Rectangle(77, 41, 133, 25));
    System.out.println(
        n.getSelectedItem().toString());
    n1.setBorder(BorderFactory.createEtchedBorder());
    n1.setBounds(new Rectangle(293, 43, 140, 24));
    n2.setBorder(BorderFactory.createEtchedBorder());
    n2.setBounds(new Rectangle(81, 45, 134, 24));
    n3.setBorder(BorderFactory.createEtchedBorder());
    n3.setBounds(new Rectangle(298, 44, 136, 24));
//--------------设置消息框的字体和按钮的字体---------------------------
    UIManager.put("OptionPane.messageFont", new Font("幼圆", Font.BOLD, 17));
    UIManager.put("OptionPane.buttonFont", new Font("幼圆", Font.BOLD, 15));
    titledBorder1 = new TitledBorder(BorderFactory.createEtchedBorder(new Color(
        173, 222, 248), new Color(165, 163, 151)), "");
    titledBorder2 = new TitledBorder(BorderFactory.createEtchedBorder(new Color(
        173, 222, 248), new Color(168, 167, 158)), "");
    border1 = new EtchedBorder(EtchedBorder.RAISED, Color.magenta,
                               new Color(165, 163, 151));
    border2 = BorderFactory.createEtchedBorder(Color.cyan,
                                               new Color(165, 163, 151));
    border3 = BorderFactory.createEtchedBorder(new Color(166, 228, 207),
                                               new Color(165, 163, 151));
    border4 = BorderFactory.createEtchedBorder(new Color(166, 228, 208),
                                               new Color(165, 163, 151));
    border5 = BorderFactory.createBevelBorder(BevelBorder.RAISED,
                                              new Color(166, 228, 208),
                                              Color.white,
                                              new Color(115, 114, 105),
                                              new Color(165, 163, 151));
    border6 = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.white,
                                              new Color(166, 228, 208),
                                              new Color(115, 114, 105),
                                              new Color(165, 163, 151));
    border7 = BorderFactory.createCompoundBorder(new EtchedBorder(EtchedBorder.
        RAISED, Color.white, Color.cyan),
                                                 BorderFactory.
                                                 createEmptyBorder(6, 6, 6, 6));
    border8 = BorderFactory.createEtchedBorder(new Color(166, 228, 208),
                                               new Color(165, 163, 151));
    border9 = BorderFactory.createLineBorder(Color.lightGray, 2);
    border10 = BorderFactory.createLineBorder(Color.lightGray, 1);
    border11 = BorderFactory.createEtchedBorder(Color.white,
                                                new Color(166, 228, 208));
    border12 = BorderFactory.createEtchedBorder(new Color(215, 222, 249),
                                                Color.white);
    border13 = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.white,
                                               Color.white,
                                               new Color(115, 114, 105),
                                               new Color(165, 163, 151));
    border14 = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.white,
                                               Color.white,
                                               new Color(115, 114, 105),
                                               new Color(165, 163, 151));
    border15 = BorderFactory.createLineBorder(SystemColor.inactiveCaptionBorder,
                                              2);
    border16 = BorderFactory.createBevelBorder(BevelBorder.LOWERED,
                                               new Color(173, 222, 235),
                                               new Color(173, 222, 248),
                                               new Color(117, 116, 110),
                                               new Color(173, 222, 248));
    border17 = BorderFactory.createEtchedBorder(UIManager.getColor(
        "Button.background"), new Color(178, 178, 178));
    border18 = BorderFactory.createLineBorder(new Color(131, 137, 161), 2);
    border19 = BorderFactory.createBevelBorder(BevelBorder.RAISED, Color.white,
                                               Color.white,
                                               UIManager.getColor(
        "Button.shadow"),
                                               new Color(168, 167, 158));
    this.getContentPane().setBackground(SystemColor.controlHighlight);
    this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    this.setFont(new java.awt.Font("Dialog", 0, 13));
    this.setForeground(SystemColor.controlHighlight);
    this.setLocale(java.util.Locale.getDefault());
//-----------------禁用最大化-----------------
    this.setResizable(false);
    this.setTitle("图书管理系统");
//---------------水平滚动条的添加--------------
    jTable1.setBackground(SystemColor.controlLtHighlight);
    jTable1.setFont(new java.awt.Font("細明體", 0, 12));

    jTable1.setBorder(BorderFactory.createEtchedBorder());
    jTable1.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    jTable2.setFont(new java.awt.Font("細明體", 0, 12));
    jTable2.setBorder(BorderFactory.createEtchedBorder());
 //   jTable2.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
//--------------给行设置高度----------------
    jTable1.setRowHeight(21);
    jTable2.setRowHeight(21);
//--------------给单行设置宽度--------------------
    this.getContentPane().setLayout(null);
//-------------给下拉框添加内容-----------------
    jComboBox1.addItem(" 读 者 编 号");
    jComboBox1.addItem(" 读 者 姓 名");
    jComboBox1.addItem(" 图 书 编 号");
    jComboBox1.addItem(" 图 书 名 称");

    jComboBox2.addItem(" 图 书 编 号");
    jComboBox2.addItem(" 图 书 名 称");
//-----------实现jradioButton单选------------------4--
    jTextField8.setBorder(BorderFactory.createEtchedBorder());
    jScrollPane1.getViewport().setBackground(Color.white);
    jScrollPane1.setFont(new java.awt.Font("細明體", 0, 12));
    jScrollPane1.setBorder(BorderFactory.createEtchedBorder());
    jButton1.setBackground(SystemColor.controlHighlight);
    jButton1.setForeground(SystemColor.activeCaption);
    jScrollPane2.getViewport().setBackground(Color.white);
    jScrollPane2.setFont(new java.awt.Font("細明體", 0, 12));
    jPanel1.setBackground(SystemColor.controlHighlight);
    jPanel5.setBackground(SystemColor.controlHighlight);
    jPanel6.setBackground(SystemColor.controlHighlight);
    jPanel6.setBorder(BorderFactory.createEtchedBorder());
    jPanel7.setBackground(SystemColor.controlHighlight);
    jTabbedPane1.setBackground(SystemColor.controlHighlight);
    jPanel2.setBackground(SystemColor.controlHighlight);
    jPanel8.setBackground(SystemColor.controlHighlight);
    jPanel10.setBackground(SystemColor.controlHighlight);
    jPanel9.setBackground(SystemColor.controlHighlight);
    jLabel2.setBackground(SystemColor.controlHighlight);
    jLabel5.setBackground(SystemColor.controlHighlight);
    jButton2.setBackground(SystemColor.controlHighlight);
    jLabel1.setBackground(SystemColor.controlHighlight);
    jLabel4.setBackground(SystemColor.controlHighlight);
    jButton4.setBackground(SystemColor.controlHighlight);
    jButton3.setBackground(SystemColor.controlHighlight);
    jComboBox1.setBackground(SystemColor.controlLtHighlight);
    jComboBox2.setBackground(SystemColor.controlLtHighlight);
    jComboBox2.setEnabled(true);
    jComboBox1.setBorder(BorderFactory.createEtchedBorder());
    jComboBox1.setDoubleBuffered(false);
    jButton7.setBackground(SystemColor.controlHighlight);
    jButton6.setBackground(SystemColor.controlHighlight);
    jButton8.setBackground(SystemColor.controlHighlight);
    jButton9.setBackground(SystemColor.controlHighlight);
    jLabel8.setBackground(SystemColor.controlLtHighlight);
    jLabel3.setBackground(SystemColor.controlHighlight);
    jLabel7.setBackground(SystemColor.controlHighlight);
    jLabel6.setBackground(SystemColor.controlHighlight);
    jTextField9.setBorder(BorderFactory.createEtchedBorder());
    jTextField6.setBorder(BorderFactory.createEtchedBorder());
    jTextField1.setBorder(BorderFactory.createEtchedBorder());
    jTextField2.setBorder(BorderFactory.createEtchedBorder());
    jTextField3.setBorder(BorderFactory.createEtchedBorder());
    jButton5.setBackground(SystemColor.controlHighlight);

    jButton10.addActionListener(new Quxiao(this));
    jButton10.setActionCommand("取消4");
    jButton10.setToolTipText("可按快捷键<Alt+L>实现功能");
    jButton10.setText("取 消");
    jButton10.setBorder(BorderFactory.createRaisedBevelBorder());
    jButton10.setFont(new java.awt.Font("Dialog", 0, 13));
    jButton10.setBackground(SystemColor.controlHighlight);
    jButton10.setBounds(new Rectangle(369, 12, 70, 23));

//-------------实现按钮的变化--------------------
    jButton1.setBorder(BorderFactory.createRaisedBevelBorder());
    jButton1.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {}
    });
    jButton1.addMouseListener(new MouseListener() {
      public void mouseExited(MouseEvent e) {
        jButton1.setBorder(BorderFactory.createRaisedBevelBorder());
      }

      public void mouseEntered(MouseEvent e) {
        jButton1.setBorder(BorderFactory.createBevelBorder(2));
      }

      public void mouseReleased(MouseEvent e) {}

      public void mousePressed(MouseEvent e) {
        jButton1.setBorder(BorderFactory.createLoweredBevelBorder());
      }

      public void mouseClicked(MouseEvent e) {}
    });

    jButton2.setBorder(BorderFactory.createRaisedBevelBorder());
    jButton2.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {}
    });
    jButton2.addMouseListener(new MouseListener() {
      public void mouseExited(MouseEvent e) {
        jButton2.setBorder(BorderFactory.createRaisedBevelBorder());
      }

      public void mouseEntered(MouseEvent e) {
        jButton2.setBorder(BorderFactory.createBevelBorder(2));
      }

      public void mouseReleased(MouseEvent e) {}

⌨️ 快捷键说明

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