Solved

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

Posted on 2000-03-10
16
322 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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
 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
custom annotations 9 38
servlet requestdispatcher include and forward differences 1 30
hibernate jars 4 28
Running JavaFX on JDeveloper 12C 1 31
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 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 …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

785 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