Hello there,
I am developing a game in java and for the options menu at the start i install a NullRepaintMana ger to override paint requests.
I was wondering however how to later go back to not using this RepaintManger i.e disable this NullRepaintMang er and return to how repaint requests are normally handled?
Any help or advice would be greatly appreciated,
Cheers,
Ragaman
P.S The code for NullRepaintMana ger:
public class NullRepaintMana ger extends RepaintManager {
public static void install() {
RepaintManager repaintManager = new NullRepaintMana ger();
repaintManager. setDoubleBuffer ingEnabled(fals e);
RepaintManager. setCurrentManag er(repaintManag er);
}
public void addInvalidCompo nent(JComponent c) {
// do nothing
}
public void addDirtyRegion( JComponent c, int x, int y,
int w, int h)
{
// do nothing
}
public void markCompletelyD irty(JComponent c) {
// do nothing
}
public void paintDirtyRegio ns() {
// do nothing
}
}
I was wondering however how to later go back to not using this RepaintManger i.e disable this NullRepaintMang er and return to how repaint requests are normally handled?
Any help or advice would be greatly appreciated,
Cheers,
Ragaman
I am developing a game in java and for the options menu at the start i install a NullRepaintMana ger to override paint requests.
I was wondering however how to later go back to not using this RepaintManger i.e disable this NullRepaintMang er and return to how repaint requests are normally handled?
Any help or advice would be greatly appreciated,
Cheers,
Ragaman
P.S The code for NullRepaintMana ger:
public class NullRepaintMana ger extends RepaintManager {
public static void install() {
RepaintManager repaintManager = new NullRepaintMana ger();
repaintManager. setDoubleBuffer ingEnabled(fals e);
RepaintManager. setCurrentManag er(repaintManag er);
}
public void addInvalidCompo nent(JComponent c) {
// do nothing
}
public void addDirtyRegion( JComponent c, int x, int y,
int w, int h)
{
// do nothing
}
public void markCompletelyD irty(JComponent c) {
// do nothing
}
public void paintDirtyRegio ns() {
// do nothing
}
}
I was wondering however how to later go back to not using this RepaintManger i.e disable this NullRepaintMang er and return to how repaint requests are normally handled?
Any help or advice would be greatly appreciated,
Cheers,
Ragaman
Comment