導航:首頁 > 編程語言 > java小說網站源代碼

java小說網站源代碼

發布時間:2023-05-05 05:09:47

java圖書管理界面系統的源代碼

javaswing登陸界面code
/*
* Login.java
*
* Created on __DATE__, __TIME__
*/

package com.agen.library.window;

import java.awt.Image;
import java.awt.Toolkit;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.;

import com.agen.library.factory.DAOFactory;
import com.agen.library.util.GlobalUser;
import com.agen.library.vo.User;

/**
*
* @author __USER__
*/
public class Login extends javax.swing.JFrame {

/**
*
*/
private static final long serialVersionUID = -2176093732040600809L;
/** Creates new form Login */
public Login() {
("易雲圖書管理軟體V1.0");
Image ime = Toolkit.getDefaultToolkit().getImage(
getClass().getResource("/images/ico.png"));
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch ( e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
setIconImage(ime);
initComponents();
setLocationRelativeTo(null);
this.setResizable(false);

}

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
// GEN-BEGIN:initComponents
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {

jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jPasswordField1 = new javax.swing.JPasswordField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
jMenuItem2 = new javax.swing.JMenuItem();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
addKeyListener(new java.awt.event.KeyAdapter() {
public void keyPressed(java.awt.event.KeyEvent evt) {
formKeyPressed(evt);
}

public void keyTyped(java.awt.event.KeyEvent evt) {
formKeyTyped(evt);
}
});

jLabel2.setFont(new java.awt.Font("微軟雅黑", 0, 14));
jLabel2.setText("\u7528\u6237\u540d\uff1a");

jLabel3.setFont(new java.awt.Font("微軟雅黑", 0, 14));
jLabel3.setText("\u5bc6 \u7801\uff1a");

jTextField1.setFont(new java.awt.Font("微軟雅黑", 0, 14));
jTextField1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField1ActionPerformed(evt);
}
});

jPasswordField1.setFont(new java.awt.Font("微軟雅黑", 0, 12));
jPasswordField1.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
jPasswordField1KeyTyped(evt);
}
});

jButton1.setBackground(new java.awt.Color(223, 216, 216));
jButton1.setFont(new java.awt.Font("微軟雅黑", 0, 14));
jButton1.setText("\u767b\u9646");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});

jButton2.setBackground(new java.awt.Color(223, 216, 216));
jButton2.setFont(new java.awt.Font("微軟雅黑", 0, 14));
jButton2.setText("\u53d6\u6d88");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});

jLabel1.setIcon(new javax.swing.ImageIcon(
getClass().getResource("/images/login_main.jpg"))); // NOI18N

jMenu1.setText("File");
jMenu1.setFont(new java.awt.Font("微軟雅黑", 0, 14));

jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
java.awt.event.KeyEvent.VK_Q,
java.awt.event.InputEvent.CTRL_MASK));
jMenuItem1.setText("Exit");
jMenuItem1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jMenuItem1MouseClicked(evt);
}
});
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem1);

jMenuBar1.add(jMenu1);

jMenu2.setText("Help");
jMenu2.setFont(new java.awt.Font("微軟雅黑", 0, 14));

jMenuItem2.setText("About");
jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem2ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem2);

jMenuBar1.add(jMenu2);

setJMenuBar(jMenuBar1);

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(layout
.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addGroup(
layout.createSequentialGroup()
.addContainerGap()
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.TRAILING,
false)
.addComponent(
jLabel2,
javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(
javax.swing.GroupLayout.Alignment.LEADING,
layout.createSequentialGroup()
.addComponent(
jLabel3)
.addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(
layout.createSequentialGroup()
.addGap(10,
10,
10)
.addComponent(
jButton1)
.addGap(47,
47,
47)
.addComponent(
jButton2))
.addComponent(
jPasswordField1)
.addComponent(
jTextField1,
javax.swing.GroupLayout.DEFAULT_SIZE,
197,
Short.MAX_VALUE))
.addContainerGap()))));
layout.setVerticalGroup(layout
.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(
layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(
jTextField1,
javax.swing.GroupLayout.PREFERRED_SIZE,
24,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(
jPasswordField1,
javax.swing.GroupLayout.PREFERRED_SIZE,
23,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(
layout.createParallelGroup(
javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton2))
.addContainerGap(
javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)));

pack();
}// </editor-fold>
// GEN-END:initComponents

private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:
About.start();
}

private void jPasswordField1KeyTyped(java.awt.event.KeyEvent evt) {
if (evt.getKeyChar() == '\n') {
String name = jTextField1.getText(); // 獲取用戶名
String pass = String.valueOf(jPasswordField1.getPassword());// 獲取密碼
User user = null;

// 未輸入用戶名
if (name.equals("") || name == null) {
JOptionPane.showMessageDialog(this, "用戶名不允許為空!", "cuowu", 0);
return;
}
try {
user = DAOFactory.getIUserDAOInstance().findById(name);
if (user != null) {
if (user.getPass() != null && user.getPass().equals(pass)) {

GlobalUser.LOGIN_USER = user; // 記錄當前用戶

// 進入主界面
Main.start();
this.dispose();
} else {
JOptionPane.showMessageDialog(this, "用戶名或密碼錯誤!");
return;
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (user == null) {
JOptionPane.showMessageDialog(this, "用戶名或密碼錯誤!", "消息", 0);
return;
}

}

}

private void formKeyTyped(java.awt.event.KeyEvent evt) {

}

private void formKeyPressed(java.awt.event.KeyEvent evt) {

}

private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
jTextField1.setText("");
jPasswordField1.setText("");
jTextField1.requestFocus();

}

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String name = jTextField1.getText(); // 獲取用戶名
String pass = String.valueOf(jPasswordField1.getPassword());// 獲取密碼
User user = null;

// 未輸入用戶名
if (name.equals("")) {
JOptionPane.showMessageDialog(this, "用戶名不允許為空!");
return;
}
try {
user = DAOFactory.getIUserDAOInstance().findById(name);
if (user != null) {
if (user.getPass() != null && user.getPass().equals(pass)) {

GlobalUser.LOGIN_USER = user; // 記錄當前用戶

// 進入主界面
Main.start();
this.dispose();
} else {
JOptionPane.showMessageDialog(this, "用戶名或密碼錯誤!", "消息", 0);
return;
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (user == null) {
JOptionPane.showMessageDialog(this, "用戶名或密碼錯誤!", "消息", 0);
return;
}

}

private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
if (JOptionPane.showConfirmDialog(this, "你確定要退出嗎?", "提示",
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
System.exit(0);
}
}

private void jMenuItem1MouseClicked(java.awt.event.MouseEvent evt) {
System.exit(1);
}

/**
* @param args
* the command line arguments
*/
public static void main(String args[]) {
// System.out.println(Login.class.getResource("src/images/images/login_main.jpg"));
// new javax.swing.ImageIcon(
// Login.class.getResource("../../../../images/login_main.jpg"));
// new Login().setVisible(true);
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Login().setVisible(true);
}
});
}

// GEN-BEGIN:variables
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JPasswordField jPasswordField1;
private javax.swing.JTextField jTextField1;
// End of variables declaration//GEN-END:variables

}

㈡ java中如何根據一個網址獲得該網頁的源代碼,急求

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class HttpTest {
String urlString;
public static void main(String[] args) throws Exception {
HttpTest client = new HttpTest(網址);
client.run();
}
public HttpTest(String urlString) {
this.urlString = urlString;
}
public void run() throws Exception {
//生成一個對象
URL url = new URL(urlString);
//打開URL
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
//得到輸入流,即獲得了網頁的內容
BufferedReader reader = new BufferedReader(new InputStreamReader(urlConnection
.getInputStream()));
String line;
// 讀取輸入流的數據,並顯示
while ((line = reader.readLine()) != null){
System.out.println(line);
}
}
}

㈢ Java訪問指定URL並獲取網頁源代碼

1.編寫 類的基本框架,該類僅包括無返回值的main ()方法,該方法從參數中獲取URL,通過輸入緩沖和輸出緩沖將該URL 原碼輸出。
2.編寫useSourceViewer 類,代碼如下:
import java.net.*;
import java.io.*;
public class useSourceViewer
{
public static void main (String[] args)
{
if (args.length > 0)
{
try
{
//讀入URL
URL u = new URL(args[0]);
InputStream in = u.openStream( );
// 為增加性能存儲輸入流
in = new BufferedInputStream(in);
// 將輸入流連接到閱讀器
Reader r = new InputStreamReader(in);
int c;
while ((c = r.read( )) != -1)
{
System.out.print((char) c);
}
Object o = u.getContent( );
System.out.println("I got a " + o.getClass().getName( ));
}
catch (MalformedURLException e)
{
System.err.println(args[0] + " is not a parseable URL");
}
catch (IOException e)
{
System.err.println(e);
}
} // end if
} // end main
} // end SourceViewer}

㈣ 基於javaweb小說閱讀網系統畢業論文

我這有幾套基於javaweb技術的在線小說網站源碼, 也可以叫做在線電子書城, 部分會版帶源碼

javaweb項目一般都是指權servlet+jsp, 或者用springmvc+mybatis這類框架寫的東西,這個根據你的要求來決定技術方案,大部分都是mvc設計模式實現的, 還是比較簡單的

㈤ 想要用java做一個小說網站,書籍的更新問題。前輩請指點下。

這個很簡單的,不是什麼問題。但是,重點是,你的小說是什麼格式。咱們以最常見的txt格式為例來討論這個問題。
1.資料庫里應該設計「小說」表,存儲每一本「小說」的信息。而這個表裡,需要有小說的id,名稱,作者等信息,而對應的,還需要有一個小說存儲的地址信息,這個地址,就是小說在你服務端的地址,即你伺服器硬碟上的存儲路徑。
2.客戶在讀小說時,客戶端發送請求,服務端接收了客戶請求,通過請求資料庫,找到每本「小說」的在伺服器硬碟上的地址,然後可以選擇將字元串讀取出來傳送回客戶端,或者直接把地址告訴客戶端讓用戶進行下載。
3.明白了這個設計,更新也很簡單。更新時,首先需要將小說上傳至服務端硬碟;然後更新資料庫,將小說的各種信息,包括存儲地址,維護進資料庫(這一步可以專門做一個管理頁面進行維護),這樣一本新的小說就更新完成了。
4.以上是大體的設計實現思路,你可以根據你的實際情況看下是否可行。

㈥ 用java寫一個網頁輸入url點擊查詢即可在下面顯示網頁源代碼

importjava.io.*;
importjava.net.*;
publicclassDemo{
publicstaticvoidmain(String[]args)throwsException{
BufferedReaderbr=newBufferedReader(newInputStreamReader(System.in));
System.out.println("請輸入要顯示源碼的地址:");
URLurl=newURL(br.readLine());
URLConnectionconn=url.openConnection();
InputStreamis=conn.getInputStream();
byte[]b=newbyte[1024];
intlen=0;
while((len=is.read(b))!=-1){
System.out.println(newString(b,0,len,"UTF-8"));
}
}
}

//下班,控制台的,網頁的你稍微修改一下就OK啦。

㈦ 求小說網站源碼

常春藤文學網站系統
ftp://203.171.239.183/asp/ArtSql1520061205.rar
不能下載的話你到這個網址自己用迅雷下載:
http://60.28.178.205/dload1.html?cid=
此網址中還有一個 常春藤文學網站系統 SQL 1.5 可以下載,希望能夠滿足你的要求

㈧ jsp小說閱讀網頁源代碼

暈,你是學校要做設計吧?在網上一找一大把的這個東西。

㈨ 求一個小說整站的源代碼

之前看過這
http://www.jieqi.com/ 傑奇小說連載系統

http://demo.jieqi.com/ 演示

一般cms都自帶採集的...具體內風格容可修改..

㈩ javaee+mysql+jsp+servlet 編寫的系統 網上書城 之類的源代碼(萬分感謝)

分有點少不,我有個符合標準的但不是書城的,是買手機電腦的,但是...你分給的少,我當初可弄了好久的。。。真想要的話,樓上說。。。。

閱讀全文

與java小說網站源代碼相關的資料

熱點內容
更新後版本英文怎麼說 瀏覽:267
桌面雲配置文件分離 瀏覽:505
iphone5如何升級4g網路 瀏覽:5
團購是在哪個app 瀏覽:897
打開多個word文檔圖片就不能顯示 瀏覽:855
騰訊新聞怎麼切換版本 瀏覽:269
app安裝失敗用不了 瀏覽:326
桌面文件滑鼠點開會變大變小 瀏覽:536
手機誤刪系統文件開不了機 瀏覽:883
微信兔子甩耳朵 瀏覽:998
android藍牙傳文件在哪裡 瀏覽:354
蘋果6s軟解是真的嗎 瀏覽:310
c語言代碼量大 瀏覽:874
最新網路衛星導航如何使用 瀏覽:425
以下哪些文件屬於圖像文件 瀏覽:774
zycommentjs 瀏覽:414
確認全血細胞減少看哪些數據 瀏覽:265
文件有哪些要求 瀏覽:484
cad打開時會出現兩個文件 瀏覽:65
什麼是轉基因網站 瀏覽:48

友情鏈接