[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Scrollable picture stack

Posted on 2011-10-17
18
Medium Priority
?
307 Views
Last Modified: 2012-05-12
Hello,
I need help with code for displaying a stack of pictures on a web page. The pictures are stored on the server in a folder named "photos", containing one to about 20 jpeg pictures of the same size. The files are named with a prefix and a number. The pictures should be displayed one at the time, changing picture back and forth quickly by scrolling with the mouse wheel over the picture. How can I do this in java?
0
Comment
Question by:Lage42
  • 6
  • 5
  • 5
  • +1
17 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 36983404
Do you think about  server side implementation (do you have java engine, like Tomcat or weblogic accessible)
or you are thinking about applet ?  
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36983406
And probably you even not need Java for such think.
Perhaps it can all be done using javascript?
0
 
LVL 43

Expert Comment

by:Rob
ID: 36983574
like this but be able to use the scroll wheel?  http://tympanus.net/Tutorials/PhotoStack/
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Lage42
ID: 36985650
The host doesn't provide a java engine.

Yes for yan, I think it could be done using javascript, but I am planning to add some image processing functionality later on, which will probably require java (unless there is a javascript solution with better performance than an applet on this simpler view/scroll task).  

Yes tagit, something like that (but see above).

Lage

0
 
LVL 10

Expert Comment

by:gordon_vt02
ID: 36988480
If your host doesn't provide a Java engine, you probably don't want to code this feature in Java.  Most hosting platforms won't let you deploy your own app container -- uses a lot of resources and they generally like to charge for that.
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36988715
In general if sticking to java, you could do it with the Applet, but it would hardly be as flexible and nice as, say, the way they've done it on that
tympanus site mentioned above, I guess with javascript/jquery
0
 

Author Comment

by:Lage42
ID: 36989272
Ok, looks like jQuery might be a good choice after all.
0
 
LVL 47

Expert Comment

by:for_yan
ID: 36989375
It probably is.
I'm not very much into jquery, but it seems to be really very powerful.
So if you have some knowledge or some time to study it, it would  probably be worth your time
0
 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 800 total points
ID: 36990301
Perhaps you want to check some of these links:
http://sixrevisions.com/tutorials/javascript_tutorial/create-a-slick-and-accessible-slideshow-using-jquery/

http://www.noupe.com/tutorial/51-best-of-jquery-tutorials-and-examples.html

from main jquery tutorial site:

http://docs.jquery.com/Tutorials

There are several photogalleries there with some explanation.

0
 
LVL 43

Assisted Solution

by:Rob
Rob earned 1200 total points
ID: 36997348
jquery also has other plugins that can capture the scrolling of the mouse to be able to cycle through an image stack.  eg taking the example i've posted above you could include the mouse wheel plugin to do that

http://plugins.jquery.com/project/mousewheel
0
 

Author Comment

by:Lage42
ID: 37033294
Thanks. The scrolling works fine with jquery. Still wondering though about the original question which was basically about how to read all files with names with a given prefix from a folder on the server into an array in a java applet.
0
 
LVL 43

Expert Comment

by:Rob
ID: 37035381
You need to use a server side script such as PHP to read the directory of images to then send to the applet.  you know you don't need an applet if you use javascript (ajax)?
0
 

Author Comment

by:Lage42
ID: 37051411
I can see that PHP needs to be involved in passing the data. The (more extensive) program which I already coded in C# some time ago, is a stand alone GUI based program and I now want to be able to run it in/from a web site using data from the server. I have very little experience of javascript (and limited experience of java) but I think I could manage porting my C# code to java. An applet (or maybe java web start) seems to be the realistic choice for this.
0
 
LVL 43

Expert Comment

by:Rob
ID: 37054446
Yes and no... porting it to java will require the java plugin, by using C# (instead of PHP) and javascript you would just need a browser

All you need is your C# (aspx) page running on an IIS server (or compatible) to scan the directory and pass the information to the webpage (synchronously) either as it loads or via javascript (ajax - asynchronous)
0
 

Author Comment

by:Lage42
ID: 37072261
Yes, of course this would work, but I am not using a IIS server and in fact I have abandoned the .net platform for this project and started coding the program using Java. Now I will try to  run it in an applet, which will require passing some data from the server using PHP.

Is there anyone else who knows how to read all files with names with a given prefix from a folder on the server and pass them into an array in a java applet.


0
 
LVL 43

Accepted Solution

by:
Rob earned 1200 total points
ID: 37072903
ok fair enough though i wasn't aware that you weren't using IIS.

There are some examples here on how to read a directory in PHP: http://php.net/manual/en/function.readdir.php

The next bit is what you're more comfortable with in java.... what would work best for you in terms of parsing the data?  XML, JSON, delimited string?  If you've already got say an XML parser coded in java then go that way.
0
 

Author Comment

by:Lage42
ID: 37156998
Thanks tagit.

Lage
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month18 days, 19 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question