Solved

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

Posted on 2000-03-10
16
325 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error in @AspectJ Based AOP with Spring 2 24
spring jars download 1 53
Java: anonymous class 4 39
Java syntax, or is it Selenium 6 43
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

730 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