Hello there,
I am developing a game in java and for the options menu at the start i install a NullRepaintManager to override paint requests.
I was wondering however how to later go back to not using this RepaintManger i.e disable this NullRepaintManger and return to how repaint requests are normally handled?
Any help or advice would be greatly appreciated,
Cheers,
Ragaman
P.S The code for NullRepaintManager:
public class NullRepaintManager extends RepaintManager {
public static void install() {
RepaintManager repaintManager = new NullRepaintManager();
repaintManager.setDoubleBufferingEnabled(false);
RepaintManager.setCurrentManager(repaintManager);
}
public void addInvalidComponent(JComponent c) {
// do nothing
}
public void addDirtyRegion(JComponent c, int x, int y,
int w, int h)
{
// do nothing
}
public void markCompletelyDirty(JComponent c) {
// do nothing
}
public void paintDirtyRegions() {
// do nothing
}
}
I was wondering however how to later go back to not using this RepaintManger i.e disable this NullRepaintManger and return to how repaint requests are normally handled?
Any help or advice would be greatly appreciated,
Cheers,
Ragaman
3 2196
Hello there,
I am developing a game in java and for the options menu at the start i install a NullRepaintManager to override paint requests.
I was wondering however how to later go back to not using this RepaintManger i.e disable this NullRepaintManger and return to how repaint requests are normally handled?
Any help or advice would be greatly appreciated,
Cheers,
Ragaman
P.S The code for NullRepaintManager:
public class NullRepaintManager extends RepaintManager {
public static void install() {
RepaintManager repaintManager = new NullRepaintManager();
repaintManager.setDoubleBufferingEnabled(false);
RepaintManager.setCurrentManager(repaintManager);
}
public void addInvalidComponent(JComponent c) {
// do nothing
}
public void addDirtyRegion(JComponent c, int x, int y,
int w, int h)
{
// do nothing
}
public void markCompletelyDirty(JComponent c) {
// do nothing
}
public void paintDirtyRegions() {
// do nothing
}
}
I was wondering however how to later go back to not using this RepaintManger i.e disable this NullRepaintManger and return to how repaint requests are normally handled?
Any help or advice would be greatly appreciated,
Cheers,
Ragaman
1.)Next time please remember the code tags when posting code.
2.)Why dont you create a new RepaintManager and set it using - RepaintManager.setCurrentManager(repaintManager);
Thank you for the advice, how do i go about setting the original repaint manager?
Thank you for the advice, how do i go about setting the original repaint manager?
How about - RepaintManager rM = new RepaintManager();
then -
RepaintManager.setCurrentManager(rM); Sign in to post your reply or Sign up for a free account.
Similar topics
by: Ike |
last post by:
I changing the size of frames dynamically in a page (I am restricted in that
I cannot perform a reload of the content of any of the frames). In MSIE,
when I resize the frames, thinks repaint...
|
by: Joe A |
last post by:
I'm using Access 2002 on Windows XP PC, 500 megs ram, Front end/back
end app.
I have a simple form that draws a thermometer to indicate progress of
code that is running. The thermometer form...
|
by: Bob |
last post by:
Trying to repaint a form named fcon using a new filter:
'Repaint the form with the new data
Forms!fcon.FilterOn = False
Forms!fcon.Filter = "RecNo = " & currecno & " AND Currentvalue = -1"...
|
by: Tamir Khason |
last post by:
Is there something RePaint event?
I have a couple of controls where I draw using control.CreateGraphics, BUT
when I lost focus or do something inside the contorl (click ,etc) all
graphics are...
|
by: MLH |
last post by:
Setting form's Picture property to another file from within
VBA doesn't repaint the form with new bitmap - for instance...
Me.Picture = "c:\pics\MyNewPic.jpg"
I tried
Me.Repaint
afterward,...
|
by: aaron.kempf |
last post by:
hey guys i have an ETL winform in VB 2005
and it's like-- off in la-la land.
i know it's doing things-- it's happily crunching away. but i'm
confused about what i need to do to make the main...
|
by: Paul |
last post by:
I have a VB.NET form with a DataGrid. When I toggle to Excel (for
example) and then back to my application the repaint of the DataGrid is
really slow. You can see the repainting happening. When...
|
by: philaphan80 |
last post by:
Is there a way to force the Visual Studio IDE (Page Control at design-
time) to refresh / repaint itself upon drag & drop of *any* item from
the toolbox? Perhaps a method I need to override within...
|
by: milkay |
last post by:
<I have code that uses 2 images>
the program creates a window and then when u press play, it removes all components in the container. then, i add a NewPanel object. i add mouse listeners and all...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |