• 大小: 233KB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2021-06-09
  • 语言: Java
  • 标签: JAVA  日记本  

资源简介

一个入门级的JAVA程序源代码,界面绝对赞,很Q的日记本,原理不复杂,代码注释非常详尽清晰,一看就懂。适合初学者。

资源截图

代码片段和文件信息

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.io.*;

public class diaryBook{
/*用到的所有图像、组件*/
static private ImageIcon startIcon=new ImageIcon(“image/start.png“);             /*start“按钮“图像*/
static private ImageIcon exitIcon=new ImageIcon(“image/exit.png“);               /*exit“按钮“图像*/
static private ImageIcon cover=new ImageIcon(“image/cover.jpg“);                 /*主封面图像*/
static private ImageIcon covertitle=new ImageIcon(“image/covertitle.png“);       /*主封面标题图像*/
static private ImageIcon writeDiary=new ImageIcon(“image/writeDiary.png“);       /*目录“写日记”标题图像*/
static private ImageIcon readDiary=new ImageIcon(“image/readDiary.png“);         /*目录“读日记”标题图像*/
static private ImageIcon backToCover=new ImageIcon(“image/backToCover.png“);     /*目录“读日记”标题图像*/
static private ImageIcon writeBG=new ImageIcon(“image/writeBG.jpg“);             /*写日记时的背景图像*/
static private ImageIcon backToCatalog=new ImageIcon(“image/backToCatalog.png“); /*“返回目录”图标*/
static private ImageIcon saveDiary=new ImageIcon(“image/saveDiary.png“);         /*“保存日记”图标*/
static private ImageIcon readBG=new ImageIcon(“image/readBG.jpg“);                /*阅读日记时的背景图像*/
static private JTextArea writeArea=new JTextArea();                 //写日记文本界面
static private JTextArea contentArea=new JTextArea();               //阅读具体日记时的文本域
static private JLabel s1=new JLabel(startIcon);                     //start label
static private JLabel exit1=new JLabel(exitIcon);                   //exit label
static private JLabel ct1=new JLabel(covertitle);                   //主封面标题label
static private JLabel wD=new JLabel(writeDiary);                    //目录标题“writeDiary”label
static private JLabel rD=new JLabel(readDiary);                     //目录标题“readDiary”label
static private JLabel bTC=new JLabel(backToCover);                  //返回主页label
static private JLabel bTCa=new JLabel(backToCatalog);               //返回目录label(for writePanel)
static private JLabel bTCa2=new JLabel(backToCatalog);              //返回目录label(for readPanel)
static private JLabel bTCa3=new JLabel(backToCatalog);              //返回目录label(for contentPanel)
static private JLabel sD=new JLabel(saveDiary);                     //保存日记label
static private JLabel diarytitleLabel=new JLabel(““);               //阅读具体日记时的标题
static private Font diaryFont=new Font(“Serif“015);               //日记正文字体及大小
static private Font diarytitleFont=new Font(“Serif“130);          //日记标题字体及大小
static private JScrollPane scrollPane1=new JScrollPane(contentArea);//阅读具体日记时的滚动条
static private JScrollPane scrollPane=new JScrollPane(writeArea);   //写日记时的滚动条

/*myDiary类*/ 
public static class myDiary extends Jframe{
/*用来相互转换的五个panel*/
private imagePanel coverPanel=new imagePanel(cover);         //封面panel
private imagePanel catalogPanel=new imagePanel(cover);       //目录panel
private imagePanel writePanel=new imagePanel(writeBG);       //写日记pa

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-04-22 00:46  yang\
     文件         301  2012-12-13 23:37  yang\.classpath
     目录           0  2012-12-17 00:01  yang\.myeclipse\
     目录           0  2012-12-17 00:01  yang\.myeclipse\profiler\
     文件         791  2012-12-17 00:01  yang\.myeclipse\profiler\diaryBook.xml
     文件         380  2012-12-13 23:37  yang\.project
     目录           0  2012-12-13 23:37  yang\.settings\
     文件         629  2012-12-13 23:37  yang\.settings\org.eclipse.jdt.core.prefs
     目录           0  2012-12-19 12:40  yang\bin\
     目录           0  2012-12-17 23:21  yang\bin\diaryBook\
     文件        1111  2012-12-19 12:55  yang\bin\diaryBook$myDiary$1.class
     文件        1486  2012-12-19 12:55  yang\bin\diaryBook$myDiary$2.class
     文件        2709  2012-12-19 12:55  yang\bin\diaryBook$myDiary$3.class
     文件        1034  2012-12-19 12:55  yang\bin\diaryBook$myDiary$imagePanel.class
     文件        2724  2012-12-19 12:55  yang\bin\diaryBook$myDiary$showContent.class
     文件        1376  2012-12-19 12:55  yang\bin\diaryBook$myDiary$turnToCatalog.class
     文件        1370  2012-12-19 12:55  yang\bin\diaryBook$myDiary$turnToCover.class
     文件        1531  2012-12-19 12:55  yang\bin\diaryBook$myDiary$turnToRead.class
     文件        1370  2012-12-19 12:55  yang\bin\diaryBook$myDiary$turnToWrite.class
     文件        6503  2012-12-19 12:55  yang\bin\diaryBook$myDiary.class
     文件        4141  2012-12-19 12:55  yang\bin\diaryBook.class
     文件        1044  2012-12-19 13:17  yang\bin\Test.class
     目录           0  2012-12-18 12:45  yang\diaryRecord\
     文件         677  2012-12-19 19:30  yang\diaryRecord\diaryRecord.dat
     文件         445  2012-12-19 19:30  yang\diaryRecord\diarytitleRecord.dat
     目录           0  2012-12-18 19:00  yang\image\
     文件        9956  2012-12-16 21:32  yang\image\backToCatalog.png
     文件        9149  2012-12-15 20:51  yang\image\backToCover.png
     文件       81170  2012-12-15 16:44  yang\image\cover.jpg
     文件       13910  2012-12-15 16:50  yang\image\covertitle.png
     文件        9232  2012-12-17 00:20  yang\image\exit.png
............此处省略13个文件信息

评论

共有 条评论