473,396 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

speeding up drawing in awt applet

does anyone guideline to speed up drawing in awt applet??

i have thousands of g.drawstring() + d.drawline()

actually, does Swing applet draw much faster than awt applet??
Jul 17 '05 #1
2 3774
On Sun, 3 Aug 2003 10:55:29 +0800, "timtt" <kl***@email.hongkong.com>
two-finger typed:
does anyone guideline to speed up drawing in awt applet??

i have thousands of g.drawstring() + d.drawline()
Use (Applet.)createImage(width,height) to create a buffer image, then use
image.getGraphics() to get a graphics context, then you can draw in the
image (in a seperate Thread, for example).
You can even get the Dimensions of the Applet for the width and height of
the image.

In paint() you would only draw the image to the Applet/screen to refresh.

I made a Mandelbrot Applet that way:
http://www.continuum.demon.nl/javadev/MandelBrot/
actually, does Swing applet draw much faster than awt applet??
Nope. I would expect slower (due to overhead) since JApplet is based
(extends) on Applet.


Cheers.
Jul 17 '05 #2

"Neomorph" <ne******@nospam.demon.co.uk> wrote in message
news:3s********************************@4ax.com...
On Sun, 3 Aug 2003 10:55:29 +0800, "timtt" <kl***@email.hongkong.com>
two-finger typed:
does anyone guideline to speed up drawing in awt applet??

i have thousands of g.drawstring() + d.drawline()


Use (Applet.)createImage(width,height) to create a buffer image, then use
image.getGraphics() to get a graphics context, then you can draw in the
image (in a seperate Thread, for example).
You can even get the Dimensions of the Applet for the width and height of
the image.

In paint() you would only draw the image to the Applet/screen to refresh.

I made a Mandelbrot Applet that way:
http://www.continuum.demon.nl/javadev/MandelBrot/

You know when you zoom in a long way on your mandelbrot applet, it begins to
look a bit grainy, do you think that is due to inaccuracy in your
implementation of the maths? I am trying to think of a way to modify your
code to avoid this, possibly by using a fractional representation rather
then FP. Or have I got his wrong?

John
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Remon Huijts | last post by:
Hi there, For a very specific service, I have created a PHP script that uses the GD library functions to create a PNG image from a few lines of XML data describing a simple diagram/drawing. It's...
1
by: nathanlaan | last post by:
This is the stupidest thing I have ever seen. Java 1.2, 1.3, and 1.4.1, and 1.4.2 all define the Applet.getDocumentBase() method differently! How am I supposed to get the directory of the document...
0
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 ...
0
by: Hermund ?rdalen | last post by:
Hi! We're developing some children's pages for one of our customers. Already we've found some nice crossword and puzzle programs/applets. What we really need now is a drawing program. It must...
0
by: Tomi Holger Engdahl | last post by:
I am looking for a solution to add on-line drawing tool to a phpBB discussion board. The idea would be that the users can draw their own simple drawings with the tool and attach them easily as...
2
by: Champika Nirosh | last post by:
Hi, I want to create drawing board application that can draw Line, rectagle, circle and free hand drawing. Each drawing need to be transparent, moveable (draggable), have bring to front and...
5
by: barbaros | last post by:
Hello everybody, I need to put some dynamic drawings on my web page. More precisely, I need to draw a number of geometric figures (circles, rectangles) which evolve into a graphics windows...
1
by: sheephead86 | last post by:
Hi, I'm pretty new to java, and I have a small problem involving drawing a rectangle on a java applet.Firstly this is not a plea for someone to help me with this peice of work, I just need pointing...
5
by: cozsmin | last post by:
Hy all, i have aproblem, i made a simple applet that works fine at a first glance, so i just wanted to add some drawing on it like : class Ap extends java.applet.Applet { ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.