| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 517 人关注过本帖
标题:这个程序的图片怎么导入
只看楼主 加入收藏
holyhsw
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2011-6-12
结帖率:40%
收藏
 问题点数:0 回复次数: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 
2011-12-06 00:29
快速回复:这个程序的图片怎么导入
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019824 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved