?
Solved

java applet displaying image from raw bytes received by socket

Posted on 2003-03-15
6
Medium Priority
?
259 Views
Last Modified: 2006-11-17
I have an Applet which receive data packets and MUST display images from the received data.
All stuff is done except the image displaying.
The data is a complete jpeg file.
It would be easy to write a file, but the applet security doesnt allow this since i dont have and dont plan to buy a signature.

Is there another way to do this?
If you have please send me an working sample code.

Thanks
0
Comment
Question by:neanderthal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 8144915
try

Image i = new ImageIcon(byteArray).getImage()

or

Image i = Toolkit.getDe

0
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 8144919
Image i = Toolkit.getDefaultToolkit().createImage(byteArray)
0
 

Author Comment

by:neanderthal
ID: 8151134
I will try this and return you a position.
Do you have some similar code?

Really thanks a lot
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:neanderthal
ID: 8223904
Works pretty fine. Thanks a lot.

By the way do you know how to force a immediate repaint of canvas?

I'm trying to use the following code but repaint occurs eventually, not in all calls.

Graphics g = getGraphics();
if (g != null)
{
update(g);
}

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 8223917
Why not just call repaint?
0
 

Author Comment

by:neanderthal
ID: 8224514
repaint does not execute a repaint at the time of call, seems it waits until its event to be processed later, in this situation i call repaint in a loop and nothing happens until i move or resize window.
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month15 days, 2 hours left to enroll

771 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