Java小项目之:小说阅读器
今天带来的java项目是一款阅读器,老少皆宜,适合练手。
代码展示:
package com;
import javax.swing.JOptionPane;
public class Scroll {
private int n;
private int size;
private Thread t;
private static int def_speed = 1000;
private static int up_speed = -500;
private static int down_speed = 500;
public int getN() {
return n;
}
public void setN(int n) {
this.n = n;
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public Scroll(){
}
public Scroll(int n,int size){
this.n = n;
this.size = size;
}
public void startScroll(){
t = new Thread(){
public void run(){
for(int j=0;j<size;j++){
Main.jta.setText("");
for(int i=n;i<=n+25;i+