Hello everyone,
I've got a question about programming by using Java applet and the question is :
Design a web page containing an applet that simply switches from one image to the next with some transition effects such as :
Fade: Fade one image out while you fade the next one in.
Whirlpoo l fade: Building on the fade transition, rather than just fading between images the first image swirls out of focus; the swirl is then reversed and as it 'unswirls' the second image is revealed
Bathroom window fade: Again building on the fade transition, the image is broken up using a bathroom window effect, and as the effect is reversed the second image is revealed.
How to proceed
If you are unsure about how to tackle this exercise, then you may wish to break it down into smaller steps:
1.Create a basic web page with a static image
2.Replace the image with an applet that displays the image
3.Make the applet change between different images, and apply transitional effects to these changes.
Thanks in advance.
9 3239
Hello everyone,
I've got a question about programming by using Java applet and the question is :
Design a web page containing an applet that simply switches from one image to the next with some transition effects such as :
Fade: Fade one image out while you fade the next one in.
Whirlpoo l fade: Building on the fade transition, rather than just fading between images the first image swirls out of focus; the swirl is then reversed and as it 'unswirls' the second image is revealed
Bathroom window fade: Again building on the fade transition, the image is broken up using a bathroom window effect, and as the effect is reversed the second image is revealed.
How to proceed
If you are unsure about how to tackle this exercise, then you may wish to break it down into smaller steps:
1.Create a basic web page with a static image
2.Replace the image with an applet that displays the image
3.Make the applet change between different images, and apply transitional effects to these changes.
Thanks in advance.
So where have you got so far? Were you able to create an html page with a picture on it? Were you able to make an applet that diplays a picture?
I do not need to make it with HTML
I need just to make applet that displays pictures with the effects in any Java software like “ Netbeans”
this is some example of the effects on the pictures.
http://www.ericharshba rger.org/cgi-bin/j.cgi?imagediss olve/index.html
http://www.ericharshba rger.org/cgi-bin/j.cgi?imagefade/index.html
http://www.ericharshba rger.org/cgi-bin/j.cgi?imagefan/index.html
*** make the effects together ****
Many Thanks in advance
I do not need to make it with HTML
I need just to make applet that displays pictures with the effects in any Java software like “ Netbeans”
this is some example of the effects on the pictures.
http://www.ericharshba rger.org/cgi-bin/j.cgi?imagediss olve/index.html
http://www.ericharshba rger.org/cgi-bin/j.cgi?imagefade/index.html
http://www.ericharshba rger.org/cgi-bin/j.cgi?imagefan/index.html
*** make the effects together ****
Many Thanks in advance
You still have to write something first. Can you write an applet that displays an image?
You still have to write something first. Can you write an applet that displays an image?
Thank you for your answer .
the applet is something like that::
import java.awt.Graphi cs;
import java.awt.Image;
import java.net.URL;
public class NewClass extends javax.swing.JAp plet implements Runnable {
volatile Thread thread;
Image img;
public void ThreadApplet() {
}
public void init() {
try {
img = getImage(new URL(getDocument Base(), "http://www.hi-seas.com/pics/pool3.jpg"));
} catch (Exception e) {
e.printStackTra ce();
}
}
public void start()
{
Thread runThread = new Thread(this);
runThread.start ();
}
public void stop()
{
thread = null;
}
public void run()
{
try
{
while (thread == Thread.currentT hread())
{
repaint();
Thread.sleep(10 00);
System.out.prin tln("This is a thread");
}
}
catch (Exception e)
{
e.printStackTra ce();
}
}
public void paint(Graphics g)
{
g.drawImage(img ,10,10,this);
}
}
Thank you for your answer .
the applet is something like that::
import java.awt.Graphi cs;
import java.awt.Image;
import java.net.URL;
public class NewClass extends javax.swing.JAp plet implements Runnable {
volatile Thread thread;
Image img;
public void ThreadApplet() {
}
public void init() {
try {
img = getImage(new URL(getDocument Base(), "http://www.hi-seas.com/pics/pool3.jpg"));
} catch (Exception e) {
e.printStackTra ce();
}
}
public void start()
{
Thread runThread = new Thread(this);
runThread.start ();
}
public void stop()
{
thread = null;
}
public void run()
{
try
{
while (thread == Thread.currentT hread())
{
repaint();
Thread.sleep(10 00);
System.out.prin tln("This is a thread");
}
}
catch (Exception e)
{
e.printStackTra ce();
}
}
public void paint(Graphics g)
{
g.drawImage(img ,10,10,this);
}
}
This will make it alternate between 2 images in the codebase - import java.awt.Graphics;
-
import java.awt.Image;
-
import java.net.URL;
-
-
-
public class NewClass extends javax.swing.JApplet implements Runnable {
-
Thread thread;
-
-
Image img;
-
-
public void ThreadApplet() {
-
}
-
-
-
public void init() {
-
try {
-
-
img = getImage(new URL(getDocumentBase(), "Sample.jpg"));
-
-
-
} catch (Exception e) {
-
e.printStackTrace();
-
}
-
}
-
public void start()
-
{
-
Thread runThread = new Thread(this);
-
runThread.start();
-
}
-
-
-
-
public void run()
-
{
-
try
-
{
-
while (true)
-
{
-
-
img = getImage(new URL(getDocumentBase(), "sunlogo64x30.gif"));
-
repaint();
-
Thread.sleep(1000);
-
getGraphics().clearRect(10, 10, img.getWidth(this), img.getHeight(this));
-
repaint();
-
img = getImage(new URL(getDocumentBase(), "Sample.jpg"));
-
repaint();
-
Thread.sleep(1000);
-
getGraphics().clearRect(10, 10, img.getWidth(this), img.getHeight(this));
-
System.out.println("This is a thread");
-
-
}
-
}
-
catch (Exception e)
-
{
-
e.printStackTrace();
-
}
-
}
-
public void paint(Graphics g)
-
{
-
g.drawImage(img,10,10,this);
-
}
-
-
-
}
This will make it alternate between 2 images in the codebase - import java.awt.Graphics;
-
import java.awt.Image;
-
import java.net.URL;
-
-
-
public class NewClass extends javax.swing.JApplet implements Runnable {
-
Thread thread;
-
-
Image img;
-
-
public void ThreadApplet() {
-
}
-
-
-
public void init() {
-
try {
-
-
img = getImage(new URL(getDocumentBase(), "Sample.jpg"));
-
-
-
} catch (Exception e) {
-
e.printStackTrace();
-
}
-
}
-
public void start()
-
{
-
Thread runThread = new Thread(this);
-
runThread.start();
-
}
-
-
-
-
public void run()
-
{
-
try
-
{
-
while (true)
-
{
-
-
img = getImage(new URL(getDocumentBase(), "sunlogo64x30.gif"));
-
repaint();
-
Thread.sleep(1000);
-
getGraphics().clearRect(10, 10, img.getWidth(this), img.getHeight(this));
-
repaint();
-
img = getImage(new URL(getDocumentBase(), "Sample.jpg"));
-
repaint();
-
Thread.sleep(1000);
-
getGraphics().clearRect(10, 10, img.getWidth(this), img.getHeight(this));
-
System.out.println("This is a thread");
-
-
}
-
}
-
catch (Exception e)
-
{
-
e.printStackTrace();
-
}
-
}
-
public void paint(Graphics g)
-
{
-
g.drawImage(img,10,10,this);
-
}
-
-
-
}
Thanks mate for your time and answer.
I tried with array of images and it is working probably.
But it is the first step in the program .
The second step is to do fade effect between images (3 images or 4 ,....)
Like this website
http://www.appletcolle ction.com/dissolveimage.h tml
****** the code of load array of images is *****
import java.awt.Graphi cs;
import java.awt.Image;
import java.net.URL;
public class NewClass extends javax.swing.JAp plet implements Runnable {
volatile Thread thread;
Image[] img = new Image[3];
Image image;
boolean stopped = false;
public void ThreadApplet() {
}
public void init() {
try {
for(int i=0;i<3;i++)
{
img[i] = getImage(getCod eBase(), i+1+".gif");
}
} catch (Exception e) {
e.printStackTra ce();
}
}
public void start()
{
Thread runThread = new Thread(this);
runThread.start ();
}
public void stop()
{
thread = null;
}
public void run()
{
try
{
int i=0;
while(!stopped)
{
image = img[i];
i = (++i)%3;
try
{
Thread.sleep(10 00);
Thread.yield();
}
catch(Exception e)
{}
repaint();
}
}
catch (Exception e)
{
e.printStackTra ce();
}
}
public void paint(Graphics g)
{
g.drawImage(ima ge,10,10,this);
}
}
Thanks mate for your time and answer.
I tried with array of images and it is working probably.
But it is the first step in the program .
The second step is to do fade effect between images (3 images or 4 ,....)
Like this website
http://www.appletcolle ction.com/dissolveimage.h tml
****** the code of load array of images is *****
import java.awt.Graphi cs;
import java.awt.Image;
import java.net.URL;
public class NewClass extends javax.swing.JAp plet implements Runnable {
volatile Thread thread;
Image[] img = new Image[3];
Image image;
boolean stopped = false;
public void ThreadApplet() {
}
public void init() {
try {
for(int i=0;i<3;i++)
{
img[i] = getImage(getCod eBase(), i+1+".gif");
}
} catch (Exception e) {
e.printStackTra ce();
}
}
public void start()
{
Thread runThread = new Thread(this);
runThread.start ();
}
public void stop()
{
thread = null;
}
public void run()
{
try
{
int i=0;
while(!stopped)
{
image = img[i];
i = (++i)%3;
try
{
Thread.sleep(10 00);
Thread.yield();
}
catch(Exception e)
{}
repaint();
}
}
catch (Exception e)
{
e.printStackTra ce();
}
}
public void paint(Graphics g)
{
g.drawImage(ima ge,10,10,this);
}
}
Yeah second step is a bit tricky. I'll have a look at it just now and will keep you posted.
My first hunch is that we're going to need
MediaTracker, PixelGrabber and MemoryImageSour ce
i guess too late........
Yep, I guess that's one of those that got lost in a desert ...
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: James Hong |
last post by:
Help please, I try to sending an email from my html page using the java
applet.
but it give error on most of the PC only very few work, what is the error i
make
the java applet show as below
**********************************
package Celcom.Client;
|
by: Don |
last post by:
Hi,
I try to get a simple applet working, the class-file does load, but the
image doesn't appear;( An error doesn't appear. The view is and stays
'grey'
What I want: Automatic refresh of a webcam image
Filename is the same. File is located in same directory as applet.
|
by: Christian Galbavy |
last post by:
Hy!
My next problem is to make an applet from my program. I have just add the
"extend applet" to my class and removed the main-method by the start-method
of the applet.
I was thinking that this is enough, but it does not work, the file does not
appear on the server. I have tried to start the applet local and also from
the server, but it does not work.
Here is the code:
*****************************************
|
by: Mark Richards |
last post by:
An applet on one of my pages uses a big picture as background.
I want to load it before the applet and the rest of the html source.
By doing this I want to avoid that the pane of the applet is grey during the
load of the picture.
How do I do that?
Or even better: How can I display something like a progress bar or at least a temporary, self removing
message (dialog) "Please wait a few second..." until the picture and the applet were...
|
by: David Van D |
last post by:
Hi there,
A few weeks until I begin my journey towards a degree in Computer
Science at Canterbury University in New Zealand,
Anyway the course tutors are going to be teaching us JAVA wth bluej and
I was wondering if anyone here would be able to give me some tips for
young players such as myself, for learning the language.
Is this the best Newsgroup for support with JAVA?
| |
by: dishal |
last post by:
Can anyone help me please? How do I convert these codes to launch from a JFrame instead of a Java Applet?
A simple program where the user can sketch curves and shapes in a
variety of colors on a variety of background colors. The user selects
a drawing color form a pop-up menu at the top of the
applet. If the user clicks "Set Background", the background
color is set to the current drawing color and the drawing
...
|
by: =?Utf-8?B?TWFya19C?= |
last post by:
I recognize that this question has a substantial Java component and I have
cross posted it on Sun’s website. But it is a problem of interface with
VS.NET and I suspect they will angrily redirect me to a .NET forum.
I have a device that serves a picture by way of a Java app. I can render the
picture in IE by navigating to the device: http://192.168.0.57/tvJVIEW.HTM
I can also fill a webbrowser control with the image:
private void...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |