java小說源碼
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用反編譯工具可以看到源代碼,
如果以上都不是你想要的答案,那麼你所說的代碼就是程序員寫好的代碼文件