当前位置:首页 » 操作系统 » java小说源码

java小说源码

发布时间: 2022-11-26 22:52:12

1. 在线迷你小说阅读器不使用数据库 CS结构java源代码~~~北大青鸟第一单元小说阅读器项目

估计是你打什么系统补丁吧?
我的现在都还能用呢,你是不是用的360啊?

2. java的库类源代码在那可以看到呢 能下载下来吗

可以看到 在eclipse中 你按住ctrl 再用鼠标点击你想查看的类 就可以直接跳转到定义该类得代码上
如果点击后没看到代码 你就点击那个叫add什么的按钮 然后浏览找到你的源代码文件( java源代码在你的jdk安装目录下,就是那个src.zip),找到src.zip,然后确定就可以看到源代码了

望采纳 望加分啊 打这么多字

3. java语言框架编写小说阅读器代码

int option = -1;
Object options[] = { "Yes", "No" };
option = JOptionPane.showOptionDialog(frame, "是否退出阅读?", "exit",
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null,
options, options[0]);
switch (option) {
case JOptionPane.YES_OPTION:
System.exit(0);
}
}

4. 谁能帮我写个Java小项目,是简单的,就写小说TXT阅读器的好了,最少要用到流和集合。麻烦注释下可以吗

只提供一个小说阅读,如下

packagereader;

importjava.awt.*;
importjava.awt.event.*;
importjava.io.*;
importjavax.swing.*;

publicclassNotebook{
privateJFrameframe;
privateJTextAreatextArea;
privateJMenuBarmenuBar;
privateJMenufile,format,search,help;
privateJMenuItemopen,exit;
privateJMenuItemfont,color,background,speed;
privateJMenuItemfind,changeto;
privateJMenuItemhelps,about;
privateBooleanautoLineWrap=true;
privateStringfileName="未命名";//文件名
//privateFilecurrentFile;
privateJScrollPanejsp;
privateJScrollBarjsb;
privateSpeedsped;
privatefontfont1;
intdelay=10;
Timertimer=newTimer(delay,newActionListener(){
publicvoidactionPerformed(ActionEventevt){
jsb.setValue(jsb.getValue()+jsb.getUnitIncrement());
}
});

publicNotebook(){
frame=newJFrame();
frame.setTitle("未命名");
frame.setLayout(newBorderLayout());
textArea=newJTextArea();
textArea.setFont(newFont("宋体",Font.PLAIN,18));//设置默认字体样式字号
//setinputtextArea设置编辑区
textArea.setText("");
textArea.setEditable(false);
textArea.setLineWrap(autoLineWrap);//设置自动换行
jsp=newJScrollPane(textArea);//setScroll
jsb=jsp.getVerticalScrollBar();
jsb.addAdjustmentListener(newAdjustmentListener(){
(AdjustmentEvente){
inti;
i=jsb.getUnitIncrement();
System.out.println(i);
}
});
frame.add(jsp,BorderLayout.CENTER);
//菜单
menuBar=newJMenuBar();
file=newJMenu("文件");
file.setMnemonic('F');
format=newJMenu("格式");
search=newJMenu("搜索");
help=newJMenu("帮助");
menuBar.add(file);
menuBar.add(format);
menuBar.add(search);
menuBar.add(help);
//文件菜单项
open=newJMenuItem("打开...",KeyEvent.VK_O);
exit=newJMenuItem("退出");
file.add(open);
file.add(exit);
//格式菜单项
//autoLine=newJCheckBoxMenuItem("自动换行");
font=newJMenuItem("字体...");
color=newJMenuItem("颜色...");
background=newJMenuItem("背景颜色...");
speed=newJMenuItem("滚屏速度...");
//format.add(autoLine);
format.add(font);
format.add(color);
format.add(background);
format.add(speed);
//搜索菜单项
find=newJMenuItem("查找...");
changeto=newJMenuItem("转到...");
search.add(find);
search.add(changeto);
//帮助菜单项
helps=newJMenuItem("帮助");
about=newJMenuItem("关于");
help.add(helps);
help.add(about);
//设置菜单条
menuBar.add(file);
menuBar.add(format);
menuBar.add(search);
menuBar.add(help);
frame.setJMenuBar(menuBar);
//sped///
sped=newSpeed(jsb,timer);
font1=newfont(textArea);
//调用监听方法
addEventHandler();
//////
textArea.addMouseListener(newMouseListener(){

publicvoidmouseClicked(MouseEvente){
if(e.getClickCount()==2){
timer.start();
}
if(e.getClickCount()==1){
timer.stop();
}

}

publicvoidmouseEntered(MouseEventarg0){
}

publicvoidmouseExited(MouseEventarg0){
}

publicvoidmousePressed(MouseEventarg0){
}

publicvoidmouseReleased(MouseEventarg0){
}
});
//监听上下键//
textArea.addKeyListener(newKeyListener(){
@Override
publicvoidkeyPressed(KeyEventarg0){
if(arg0.getKeyCode()==KeyEvent.VK_UP){
jsb.setValue(jsb.getValue()-jsb.getUnitIncrement());
}
if(arg0.getKeyCode()==KeyEvent.VK_DOWN){
jsb.setValue(jsb.getValue()+jsb.getUnitIncrement());
}
}

publicvoidkeyReleased(KeyEventarg0){
}

publicvoidkeyTyped(KeyEventarg0){
}
});
//
textArea.addMouseListener(newMouseListener(){

@Override
publicvoidmouseClicked(MouseEvente){
if(e.getClickCount()==2){
timer.start();
}
if(e.getClickCount()==1){
timer.stop();
}

}

publicvoidmouseEntered(MouseEventarg0){
}

publicvoidmouseExited(MouseEventarg0){
}

publicvoidmousePressed(MouseEventarg0){
}

publicvoidmouseReleased(MouseEventarg0){
}
});

}

///////////初始化frame////////////////
protectedvoidframeInit(){
Dimensiond=Toolkit.getDefaultToolkit().getScreenSize();
frame.setSize(d.width,d.height);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Dimensionb=frame.getSize();
}

privatevoidaddEventHandler(){
//文件项的监听
open.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEvente){
fileOpen();
jsb.setValue(0);
}
});
exit.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEvente){
fileExit();
}
});
//格式菜单的监听
font.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEvente){
font1.addEventHandler();
}
});
color.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEvente){
formatColor();
}
});
background.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEvente){
formatBackground();
}
});

speed.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEvente){
sped.liser();
}
});
}

//////////文件项的方法/////////////////////////
privatevoidfileOpen(){
textArea.setText("");
JFileChooserfileChooser=newJFileChooser();
fileChooser.showOpenDialog(frame);
Filefile=fileChooser.getSelectedFile();
if(file==null)
return;
fileName=file.getName();//获得文件名
frame.setTitle(file.getAbsolutePath());
FileInputStreamfis=null;
BufferedReaderbr=null;
try{
fis=newFileInputStream(file);
br=newBufferedReader(newInputStreamReader(fis));
Stringstr=null;
while((str=br.readLine())!=null){
textArea.append(str+" ");
}
System.out.println("打开成功");
textArea.setCaretPosition(0);
}catch(IOExceptione1){
JOptionPane.showMessageDialog(frame,"文件不存在或已被损坏");
}finally{
if(br!=null)
try{
br.close();
}catch(IOExceptione){
}
if(fis!=null)
try{
fis.close();
}catch(IOExceptione){
}
}
}

privatevoidfileExit(){
intoption=-1;
Objectoptions[]={"Yes","No"};
option=JOptionPane.showOptionDialog(frame,"是否退出阅读?","exit",
JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,
options,options[0]);
switch(option){
caseJOptionPane.YES_OPTION:
System.exit(0);
}
}

////////////////////////////////////////////////////////////
/////////////////格式项的方法/////////////////////////////////
privatevoidformatColor(){
//弹出颜色色选择器对话框
Colorcolor=JColorChooser.showDialog(textArea,"选择颜色",Color.BLACK);
textArea.setForeground(color);
}

privatevoidformatBackground(){
//弹出颜色色选择器对话框
Colorcolor=JColorChooser.showDialog(textArea,"选择颜色",Color.BLACK);
textArea.setBackground(color);
}

//////////////////////////////////////////////////////////////

publicstaticvoidmain(Stringargs[]){
Notebooknt=newNotebook();
nt.frameInit();

}

}

classfont{
privateJTextAreatextArea;
privateJButtonok,cancel;
privateJComboBoxfontName,fontSize,fontStyle;
GraphicsEnvironmentge;//定义系统字体对象
String[]size={"8","10","12","14","16","18","20","22","24",
"26","28","32","36","48","72","96"};
String[]style={"PLAIN","BOLD","ITALIC"};
JFramejf=newJFrame("字体设置");

publicfont(JTextAreatextArea){
this.textArea=textArea;
JLabellabel1=newJLabel(
"字体");
JLabellabel2=newJLabel("字号");
JLabellabel3=newJLabel("样式");
ge=GraphicsEnvironment.getLocalGraphicsEnvironment();//获取系统字体
String[]fontname=ge.getAvailableFontFamilyNames();
fontName=newJComboBox(fontname);
fontSize=newJComboBox(size);
fontStyle=newJComboBox(style);
ok=newJButton("确定");
cancel=newJButton("取消");
jf.setLayout(newBorderLayout());
JPanelp1=newJPanel();
JPanelp2=newJPanel();
JPanelp3=newJPanel();
p1.add(label1);
p1.add(label2);
p1.add(label3);
p2.add(fontName);
p2.add(fontSize);
p2.add(fontStyle);
p3.add(ok);
p3.add(cancel);
jf.add(p1,BorderLayout.NORTH);
jf.add(p2,BorderLayout.CENTER);
jf.add(p3,BorderLayout.SOUTH);
jf.setSize(360,200);
jf.setLocation(300,200);
jf.setVisible(false);
jf.setResizable(false);
//addEventHandler();
}

voidaddEventHandler(){
jf.setVisible(true);
ok.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEvente){
Stringn1=(String)fontName.getSelectedItem();
intn2=fontStyle.getSelectedIndex();
Stringn3=(String)fontSize.getSelectedItem();
textArea.setFont(newFont(n1,n2,Integer.parseInt(n3)));
jf.setVisible(false);
}
});
cancel.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEvente){
jf.setVisible(false);//
}
});
}
}

{
privateJScrollBarjsb;
privateJFramejfrm;
privateJLabeljlb1;
//JLabeljlb2;
privateJButtonjbt;
//privateJCheckBoxjcheckbox;
privateJComboBoxjcbb;
Integersu;
Timertimer;
privateIntegermsg[]={1,10,18,36,48,66,80,90};

publicSpeed(finalJScrollBarjsb,finalTimertimer){
this.jsb=jsb;
this.timer=timer;
jfrm=newJFrame();
jlb1=newJLabel("滚屏速度");
jbt=newJButton("确定");
//jcheckbox=newJCheckBox("自动滚屏");
jcbb=newJComboBox(msg);
jfrm.setLayout(newFlowLayout());
jfrm.add(jlb1);
jfrm.add(jcbb);
//jfrm.add(jcheckbox);jfrm.add(jbt);
jfrm.setVisible(false);
jcbb.setEditable(true);
jfrm.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
jfrm.pack();
}

voidliser(){
jfrm.setVisible(true);
///////监听复选框///////////////////////////
jcbb.addItemListener(this);
/*
*jcbb.addActionListener(newActionListener(){publicvoid
*actionPerformed(ActionEvente){
*jcbb.setSelectedIndex(jcbb.getSelectedIndex());}});
*/
/////////监听按钮//////////////////////////
jbt.addActionListener(newActionListener(){
publicvoidactionPerformed(ActionEventarg0){
jfrm.setVisible(false);
}
});
//////////////////////////////////////

/*
*jcheckbox.addItemListener(newItemListener(){publicvoid
*itemStateChanged(ItemEvente){if(jcheckbox.isSelected()==false){
*System.out.println("false");timer.stop();}
*if(jcheckbox.isSelected()==true){timer.start();}}});
*/
}

@Override
publicvoiditemStateChanged(ItemEventarg0){
su=(Integer)jcbb.getSelectedItem();
//jcbb.setSelectedItem(msg);//jcbb.updateUI();
jsb.setUnitIncrement(su.intValue());
}
}

5. eclipse怎么查看java源代码

在Eclipse中查看JDK类库的源代码

设置:

1.点 “window”-> "Preferences" -> "Java" -> "Installed JRES"

6. 你好,在百度文库里看到了你上传的文件,小说阅读器java语言程序设计报告,能把源代码打包发给我吗谢谢,

这个时间太久了,我找不到了推荐你上CSDN网站,那上面有!

7. 求java编写的小说网站所有源码

可以用jsp实现的,就是读数据的过程。

8. 想要用java做一个小说网站,书籍的更新问题。前辈请指点下。

这个很简单的,不是什么问题。但是,重点是,你的小说是什么格式。咱们以最常见的txt格式为例来讨论这个问题。
1.数据库里应该设计“小说”表,存储每一本“小说”的信息。而这个表里,需要有小说的id,名称,作者等信息,而对应的,还需要有一个小说存储的地址信息,这个地址,就是小说在你服务端的地址,即你服务器硬盘上的存储路径。
2.客户在读小说时,客户端发送请求,服务端接收了客户请求,通过请求数据库,找到每本“小说”的在服务器硬盘上的地址,然后可以选择将字符串读取出来传送回客户端,或者直接把地址告诉客户端让用户进行下载。
3.明白了这个设计,更新也很简单。更新时,首先需要将小说上传至服务端硬盘;然后更新数据库,将小说的各种信息,包括存储地址,维护进数据库(这一步可以专门做一个管理页面进行维护),这样一本新的小说就更新完成了。
4.以上是大体的设计实现思路,你可以根据你的实际情况看下是否可行。

9. java新手,求完整的源代码

//都是从新手过来的,以下代码供参考
//1.
publicclassBankAccount{
privatestaticStringacctnum;
privatestaticdoublemoney;

privatestaticvoidshowAcct(){
System.out.println("账号为:"+acctnum);
}

privatestaticvoidshowMoney(){
System.out.println("余额为:"+money);
}

publicBankAccount(Stringacc,doublem){
this.acctnum=acc;
this.money=m;
}

publicstaticvoidmain(String[]args){
BankAccountba=newBankAccount("626600018888",5000.00);
ba.showAcct();
ba.showMoney();

}

}

//2.

publicclassTriangle{
privatestaticfloata;
privatestaticfloatb;
privatestaticfloatc;

publicTriangle(floata,floatb,floatc){
this.a=a;
this.b=b;
this.c=c;
}

(floata,floatb,floatc){
if((a>Math.abs(b-c)&&a<b+c)
&&(b>Math.abs(a-c)&&b<a+c)
&&(c>Math.abs(a-b)&&c<a+b))
returntrue;
else
returnfalse;
}

publicfloatgetCircumference(){
returnthis.a+this.b+this.c;
}
}

//3.

publicclassTestTriangle{


publicstaticvoidmain(String[]args){
Trianglet=newTriangle(5.3f,7.8f,9.3f);

if(t.judgeTriangle(5.3f,7.8f,9.3f)){
System.out.print("能够成三角形,周长为:");
System.out.printf("%9.2f",t.getCircumference());}
else
System.out.println("不能构成三角形");
}

}

10. 什么是java源代码 怎么查看

不知道你说的是浏览器的还是什么的,
如果是浏览器的那么简单找到工具-查看源代码,你就能看见代码了,
还有一个就是被编译成class文件的java用反编译工具可以看到源代码,
如果以上都不是你想要的答案,那么你所说的代码就是程序员写好的代码文件

热点内容
云访问安全 发布:2025-05-17 18:36:31 浏览:624
算法设计与分析课件 发布:2025-05-17 18:21:11 浏览:766
安卓禁止软件安装怎么解除 发布:2025-05-17 18:16:52 浏览:219
绝地求生极客电脑怎么配置 发布:2025-05-17 18:16:50 浏览:51
显卡编程语言 发布:2025-05-17 18:11:46 浏览:919
编程用什么轴机械键盘 发布:2025-05-17 18:10:35 浏览:960
金融工程编程 发布:2025-05-17 18:10:33 浏览:224
私密模式访问 发布:2025-05-17 18:09:44 浏览:788
数据库崩溃原因 发布:2025-05-17 18:09:42 浏览:307
对虾养殖增氧机如何配置 发布:2025-05-17 18:08:20 浏览:443