Solved

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

Posted on 2000-03-10
16
327 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
[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
  • 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This video teaches viewers about errors in exception handling.
Suggested Courses

632 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