当前位置: 代码迷 >> Java相关 >> 这个程序的图片怎么导入
  详细解决方案

这个程序的图片怎么导入

热度:261   发布时间:2011-12-06 00:29:17.0
这个程序的图片怎么导入
package com.hcht.JFrame;

import java.awt.Container;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.JTextField;

import com.hcht.util.CreateIcon;

public class LibraryReaderDeleteAndAlter extends JFrame{
    private javax.swing.JLabel libshow;
   
    public LibraryReaderDeleteAndAlter(){
        super("读者信息查询,修改和删除");
        libshow=new JLabel();
        ImageIcon icon=CreateIcon.add("images\\login.jpg");
        libshow.setIcon(icon);
        libshow.setBounds(0,0,600,95);
        this.add(libshow);
        this.setLayout(null);
        //查询框
        JTextArea jTextSelect=new JTextArea();
        jTextSelect.setBounds(0,100,600, 100);
        
        //姓名
        JLabel reader_Name=new JLabel("姓名:");
        reader_Name.setBounds(20, 210,100, 25);
        JTextField Jreader_Name=new JTextField();
        Jreader_Name.setBounds(125,210,150,25);
        this.add(reader_Name);
        this.add(Jreader_Name);
        
        //办证日期
        JLabel reader_Card_Transact_Date=new JLabel("办证日期:");
        reader_Card_Transact_Date.setBounds(20,240,100,25);
        JTextField Jreader_Card_Transact_Date=new JTextField();
        Jreader_Card_Transact_Date.setBounds(125,240,150,25);
        this.add(reader_Card_Transact_Date);
        this.add(Jreader_Card_Transact_Date);
        
        //有效日期
        JLabel reader_Card_Lapse_Date=new JLabel("有效日期至:");
        reader_Card_Lapse_Date.setBounds(20,270,100,25);
        JTextField Jreader_Card_Lapse_Date=new JTextField();
        Jreader_Card_Lapse_Date.setBounds(125,270,150,25);
        this.add(reader_Card_Lapse_Date);
        this.add(Jreader_Card_Lapse_Date);
        
        //班级
        JLabel reader_Class=new JLabel("班级:");
        reader_Class.setBounds(20,300,100,25);
        JTextField Jreader_Class=new JTextField();
        Jreader_Class.setBounds(125,300,150,25);
        this.add(reader_Class);
        this.add(Jreader_Class);
        
        //性别
        JLabel reader_Sex=new JLabel("性别:");
        reader_Sex.setBounds(20,330,100,25);
        JTextField Jreader_Sex=new JTextField();
        Jreader_Sex.setBounds(125,330,150,25);
        this.add(reader_Sex);
        this.add(Jreader_Sex);
        
        
        JLabel reader_Academy=new JLabel("学院:");
        reader_Academy.setBounds(320,210, 100, 25);
        JTextField Jreader_Academy=new JTextField();
        Jreader_Academy.setBounds(425, 210, 150, 25);
        this.add(reader_Academy);
        this.add(Jreader_Academy);
        
        
        JLabel reader_Profession=new JLabel("专业:");
        reader_Profession.setBounds(320,240, 100,25);
        JTextField Jreader_Profession=new JTextField();
        Jreader_Profession.setBounds(425,240,150,25);
        this.add(reader_Profession);
        this.add(Jreader_Profession);
        
        JLabel reader_Card_ID=new JLabel("证件号码:");
        reader_Card_ID.setBounds(320,270,100,25);
        JTextField Jreader_Card_ID=new JTextField();
        Jreader_Card_ID.setBounds(425,270,150,25);
        this.add(reader_Card_ID);
        this.add(Jreader_Card_ID);
        
        
        JLabel reader_Card_status=new JLabel("图书证状态:");
        reader_Card_status.setBounds(320,300,100,25);
        JTextField Jreader_Card_status=new JTextField();
        Jreader_Card_status.setBounds(425,300,150,25);
        this.add(reader_Card_status);
        this.add(Jreader_Card_status);
        
        JLabel reader_Amercement=new JLabel("罚款:");
        reader_Amercement.setBounds(320,330,100,25);
        JTextField Jreader_Amercement=new JTextField();
        Jreader_Amercement.setBounds(425,330,150,25);
        this.add(reader_Amercement);
        this.add(Jreader_Amercement);
        
        JButton btnAlter=new JButton("修改");
        btnAlter.setBounds(200,360,60,25);
        this.add(btnAlter);
        
        JButton btnDelete=new JButton("删除");
        btnDelete.setBounds(300,360,60,25);
        this.add(btnDelete);
        
        this.add(jTextSelect);
        
        
        
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setSize(600,450);
        this.setVisible(true);
        
        
        
    }
public static void main(String[] args) {
    new LibraryReaderDeleteAndAlter();
}

private javax.swing.JButton btnAlter;//修改
private javax.swing.JButton btnDelete;//删除

private javax.swing.JLabel reader_Name;//姓名
private javax.swing.JLabel reader_Card_Transact_Date;//办证日期
private javax.swing.JLabel reader_Card_Lapse_Date;//有效日期
private javax.swing.JLabel reader_Class;//班级
private javax.swing.JLabel reader_Sex;//性别
private javax.swing.JLabel reader_Profession;//专业
private javax.swing.JLabel reader_Card_ID;//证件号码
private javax.swing.JLabel reader_Amercement;//罚款
private javax.swing.JLabel reader_Card_status;//状态
private javax.swing.JLabel reader_Academy;//学院


private javax.swing.JTextArea jTextSelect;//查询界面

private javax.swing.JTextField Jreader_Name;//姓名
private javax.swing.JTextField Jreader_Card_Transact_Date;//办证日期
private javax.swing.JTextField Jreader_Card_Lapse_Date;//有效日期
private javax.swing.JTextField Jreader_Class;//班级
private javax.swing.JTextField Jreader_Sex;//性别

private javax.swing.JTextField Jreader_Academy;//学院
private javax.swing.JTextField Jreader_Profession;//专业
private javax.swing.JTextField Jreader_Card_ID;//证件号码
private javax.swing.JTextField Jreader_Card_status;//状态
private javax.swing.JTextField Jreader_Amercement;//罚款

}
图片已经在文件夹了。但是怎么都导不进?求解释。

搜索更多相关的解决方案: class  图片  private  package  public  

----------------解决方案--------------------------------------------------------
  相关解决方案