Answer Posted / m!r@
Double Buffering
sample code of java to reduce flinking :
public void update(Graphics g) {
Graphics offgc;
Image offscreen = null;
Dimension d = size();
offscreen = createImage(d.width, d.height);
offgc = offscreen.getGraphics();
offgc.setColor(getBackground());
offgc.fillRect(0, 0, d.width, d.height);
offgc.setColor(getForeground());
paint(offgc);
g.drawImage(offscreen, 0, 0, this);
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Why destructor is not used in java?
why are there separate wait and sleep methods? : Java thread
What is the static variable?
What is a map in java?
what are synchronized methods and synchronized statements? : Java thread
Why object class is super class for every class in java?
What is meant by binding in rmi?
Write the algorithm to check the number non-leaf nodes in a tree.
Explain the difference between transient and volatile in java?
What are classloaders?
What is stringreader?
What is multi level inheritance in java?
What is array and arraylist in java?
4.1 Supply contracts (in the form of comments specifying pre- and post conditions) for the enqueue() method of the LinkedQueue class given in the Appendix. (2) 4.2 Let Thing be a class which is capable of cloning objects, and consider the code fragment: Thing thing1 = new Thing(); //(1) Thing thing2 = thing1; //(2) Thing thing3 = (Thing) thing1.clone(); //(3) Explain how the objects thing2 and thing3 differ from each other after execution of the statements. (
Explain the reason behind ending a program with a system.exit(0)?