网站首页 > 文章中心 > 其它

java编写相册代码

作者:小编 更新时间:2023-09-24 07:36:27 浏览量:456人看过

用java,jsp,和jstl表达式做的相册,如何实现分页的局部刷新?

script?type="text/javascript"

$(document).ready(function(){

$("#pageNav?a").click(function(){

java编写相册代码-图1

var?idx?=?$("#pageNav?a").index($(this));//返回当前元素在导航的超链接集合中索引

var?curPageNo=parseInt($("#pageNo").val());//当前页数,因为要计算,注意类型转换

var?totalPage=$("#totalPage").val();//总页数

var?pageNo=1;//要请求的页面

switch(idx){

case?0:

pageNo=1;

break;

case?1:

java编写相册代码-图2

pageNo=curPageNo-1;

pageNo=curPageNo+1;

pageNo=totalPage;

}

$.getJSON("${pageContext.request.contextPath?}/student/getPageJson",{pageNo:pageNo},function(json){

//更新当前页面数

$("#pageNo").val(json.pageNo);

//更新表格中的数据

//删除旧数据

$("#studentData?tr:gt(0)").remove();//删除非第一行的元素

//添加新查询的数据

//遍历json中data集合

var?str;

$.each(json.data,function(idx,stu){

str="";

str+="tr";

str+="td"+stu.id+"/td"

str+="td"+stu.name+"/td"

str+="td"+stu.birth+"/td"

str+="tdinput?type=\"checkbox\"?value=\""+stu.id+"\"?name=\"delIds\"//td";

str+="/tr";

$("#studentData").append(str);//将集合中的每一个元素转换为一个tr元素,并附加到表格中

});

})

$("#selectAll").click(function(){

$("#studentData?:checkbox").prop("checked","true");

/script

/head

body

!--?页头开始?--

jsp:include?page="header.jsp"/jsp:include

!--?页头结束?--

!--内容开始?--

jsp:include?page="menu.jsp"/jsp:include

form?action="student/deleteSelectedStudent"

table?id="studentData"

tr

tdID/td

td姓名/td

td生日/td

td删除/td

/tr

c:forEach?items="${page.data?}"?var="student"

td${student.id?}/td

td${student.name?}/td

tdfmt:formatDate?value="${student.birth?}"?pattern="yyyy-MM-dd"/?/td

tdinput?type="checkbox"?value="${student.id?}"?name="delIds"//td

/c:forEach

/table

input?type="button"?value="全选"?id="selectAll"/

input?type="submit"?value="删除所选"

/form

%--?

第${page.pageNo}页

共${page.totalPage}页

a?href="student/listStudent?pageNo=1"第一页/a

c:if?test="${!page.firstPage?}"

a?href="student/listStudent?pageNo=${page.pageNo-1?}"上一页/a

/c:if

c:if?test="${!page.lastPage?}"

a?href="student/listStudent?pageNo=${page.pageNo+1?}"下一页/a

a?href="student/listStudent?pageNo=${page.totalPage?}"最后一页/a

--%

!--?使用jquery及json实现基于异步请求的分页?--

input?type="hidden"?id="pageNo"?value="${page.pageNo}"/

input?type="hidden"?id="totalPage"value="${page.totalPage}"/

a?href="javascript:void(0)"第一页/a

a?href="javascript:void(0)"上一页/a

a?href="javascript:void(0)"下一页/a

a?href="javascript:void(0)"最后一页/a

java编写相册代码-图3

!--内容结束?--

!--?页脚开始?--

jsp:include?page="footer.jsp"/jsp:include

!--?页脚结束?--

求Java网络相册程序源代码.类似QQ相册具有上传,相册,查看等基本功能即可.

这种程序网上一搜一大把,不过很多不能用,提供我找到的一个,含数据库.我用它做毕业设计,通过!

用java做了个电子相册 想在程序运行到结束循环播放一首歌,代码怎么写啊往哪加?

你的电子相册是自动播放的? 如果是这样你直接在程序结束的前面加呗.如果是手动播放的话,你加那玩意有意义?还不如加背景音乐.

java 电子相册的制作

import java.applet.Applet;

import java.applet.AudioClip;

import java.awt.Graphics;

import java.awt.Image;

public class JavaPhoto extends Applet{

Image[]images;

int totalImage=10;

int currentImage=0;

public void init(){

AudioClip audioClip=getAudioClip(getCodeBase(),"friend.wav");

new Thread() {

public void run() {

audioClip.loop();

}.start();

System.out.println("llll");

images=new Image[totalImage];

System.out.println("--"+getDocumentBase());

for(int i=0;itotalImage;i++){

images[i]=getImage(this.getCodeBase(),i+".jpg");

currentImage=0;

public void paint(Graphics g){

g.drawImage(images[currentImage],0,0,this);

System.out.println("+++"+currentImage);

currentImage=++currentImage%totalImage;

try{

System.out.println("oooooooo");

}catch(InterruptedException e){

showStatus(e.toString());

System.out.println("********");

repaint();

System.out.println("ppppp");

java,web电子相册源码

我这有几套基于javaweb的电子相册源码, 基础功能都有实现

项目基于springmvc+spring+mybatis进行实现, BS架构, MVC设计模式分层实现, 数据库采用mysql 还是比较简单的

谁能给我一个JAVA电子相册或音乐播放器的代码啊 急急急

我自己做过一个类似的电子相册,但功能很不够全面,给你参考下...

import java.awt.*;

import java.awt.event.*;

import java.applet.*;

{

public void init()

setBackground(Color.cyan);

setVisible(true);

setLayout(null);

btn1=new Button("下一页");

add(btn1);

add(cvs);

btn1.addActionListener(cvs);

validate();

class Backcolor extends Thread

public void run()

{int j=0;int m=0;int n=0;

while(true)

j++;

sleep(100);

Color col1=new Color(j,m,n);

setBackground(col1); }

m++;

n++;

catch(InterruptedException e){}

public void start()

Image[] img;

int pg=0;

volatile boolean pleaseStop;

//String FONTS="Serif";

Toolkit tl=getToolkit();

for(int i=0;i=11;i++)

img[i]=tl.getImage("img0"+i+".JPG");

class Play extends Thread

while(!pleaseStop)

pg++;

if(pg11){pg=0;}

public void actionPerformed(ActionEvent e)

Play thread=new Play();

pg--;

if(pg0){pg=11;}

pleaseStop=false;

thread.start();

pleaseStop=true;

public void paint(Graphics g)

/*g.setColor(Color.black);

/*

/applet

*/

以上就是土嘎嘎小编为大家整理的java编写相册代码相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!

版权声明:倡导尊重与保护知识产权。未经许可,任何人不得复制、转载、或以其他方式使用本站《原创》内容,违者将追究其法律责任。本站文章内容,部分图片来源于网络,如有侵权,请联系我们修改或者删除处理。

编辑推荐

热门文章