Solved

Flickering Applet :-How to avoid filickering and painting of graphics with background

Posted on 2000-03-10
16
320 Views
Last Modified: 2008-03-17
I am placing a JTextarea on a Japplet having layout null. Based on the mousemovement iam setting Bounds for JTextarea and displaying.  Whenever iam displaying JTextArea the JApplet container is getting painted with background color of container and iam able to observe flickering on out graphics. How to avoid filickering and painting of graphics with background color which is damaging my foreground graphics.
0
Comment
Question by:bava_anand
  • 6
  • 5
  • 2
  • +2
16 Comments
 
LVL 1

Expert Comment

by:filipecorreia
ID: 2605969
I don't have mutch time to answer so I've got only two words for you:
double buferring.


Try poniting in that direction...




Filipe Correia
0
 

Accepted Solution

by:
Shanoj earned 250 total points
ID: 2607235
Try mediatracker
0
 

Expert Comment

by:prabhuram
ID: 2607270
Hi,

   1. why dont you make everything in a canvas or in a frame??
   
    2.why dont you invoke the paint message in the discrete intervals??
        It'll avoid the flickering of the applet.
           ( i am not sure that its possible to  make the threads in the applet procedure. if is possible, then create the thread that'll invoke the paint
message in the discrete intervals )


Try it.
I hope that it'll work fine.
0
 

Author Comment

by:bava_anand
ID: 2607289
We used double buffering, i.e we created image and placed on our graphics, still when we are viewing the tooltips we are observing flickeing and painting with the background color.


We also implemented paint method frequently using timer object yet we are able to see flickering when tooltips are displayed.

Shanoj i don't have any idea about mediatracker can u guide reg. that
0
 

Expert Comment

by:Shanoj
ID: 2607438
U can use the MediaTracker class and add the image to it using addImage method. This will make the mediatracker object to track your graphics image.
0
 
LVL 1

Expert Comment

by:filipecorreia
ID: 2607554
Implemented paint method frequently using a timer isn't a good solution.
You should only use the paint method when you make some change to the foreground image because it may become very slow.

Witch tooltips do you mean? do you have tooltips for the image or are there tooltips for a component near the image?



  Filipe Correia
0
 

Author Comment

by:bava_anand
ID: 2607641
Filipe Correia,
as u said we are using timer and calling paintmethod frequently .

We are using tooltip and setting its component to my Japplet container and we are moving the tooltip as the mouse moves, when this action is going on we are observing flickering on the background graphics which we have drawn using doublebuffering.

0
 

Author Comment

by:bava_anand
ID: 2607643
Adjusted points to 250
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:bava_anand
ID: 2607644
Filipe Correia,
as u said we are using timer and calling paintmethod frequently .

We are using tooltip and setting its component to my Japplet container and we are moving the tooltip as the mouse moves, when this action is going on we are observing flickering on the background graphics which we have drawn using doublebuffering.

0
 
LVL 7

Expert Comment

by:Sasha_Mapa
ID: 2764501
Is this thread still alive? Anyway, double buffering should solve your problem. There is no way that you can see when using double buffering. If you would like an example please reject the currently proposed answer.
0
 
LVL 7

Expert Comment

by:Sasha_Mapa
ID: 2764503
It was supposed to be: "There is no way that you can see flickering when using double buffering correctly".
0
 
LVL 7

Expert Comment

by:Sasha_Mapa
ID: 2780523
Hmm, strange choice you made there, bava_anand, as MediaTracker has absolutely nothing to do with your problem <sigh>
0
 

Author Comment

by:bava_anand
ID: 2783908
What a blunder i have done,
iam really  sorry Sasha_Mapa, i have seen your answer and accepted your answer but iam wondering  how it is accepted the other person answer(Shanoj). I really accept my mistake. I have tried double buffering it is working perfectly, i don't have any idea of Media tracker.

Once again sorry for the mistake, i accept DOUBLE BUFFERING is the correct one.
0
 
LVL 7

Expert Comment

by:Sasha_Mapa
ID: 2784066
You can post a question on the Community support topic area asking them to revert the situation to the previous and distribute the points in any way you want (just please don't accept my comment with a C grade... If you wish I could give you a real answer with an example on double buffering).
To get to the Community Support topic area, go to the bottom of this page and click on the Community Support link.
0
 

Author Comment

by:bava_anand
ID: 2785890
How can i revert the situation to the previous and distribute the points in any way i want? I can only able to post the question in the community support link. Please clarify Sasha_Mapa.
0
 
LVL 7

Expert Comment

by:Sasha_Mapa
ID: 2785982
You post ANOTHER question on Community Support asking the folks responsible for this site to look at the situation of this question and specifying how you want to distribute/redistribute the points. One of them (usually a guy named darinw) will handle the situation. The Community Support topic area is being constantly monitored by him.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now