As expected, if you don’t add extra code, drawing things that move on the applet surface will result in flickering. It’s ugly, it hurts eyes and it just looks unprofessional.
The remedy is simple and works with all technologies and platforms – draw to the off-screen buffer and then just slap the whole buffer to the screen in one go. This is very easy to implement in Java since you can get a Graphics class out of the Image (that represents your off-screen buffer) and then when you draw to this Graphics everything is drawn to the Image.
Except that the flickering is still there. Just like with Windows API applications, the problem is that there is an “erase background” step. In Windows API the culprit is WM_ERASEBACKGROUND message, in Java it’s the update method of the Applet class. Override update method and only call your paint method – it’s that simple.
By the way, don’t forget to recreate the off-screen buffer when the applet’s size changes. Most of the applets are fixed size, but some could be detached from the browser and then they might become resizable.
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
I wrote about books on the Windows Presentation Foundation (WPF from now on) before. I am one of those that thinks WPF is significant for all Windows developers. Once Microsoft sets the standard with WPF, I am sure other vendors will follow and WPF (or a variant of it) will become significant for developers on other platforms too.
Quite some time ago, I bought and read Chris Sells’ and Ian Griffiths’ WPF book. It was good and I liked it. Chris Andersons’ book is still in the finishing stages, but Petzold’s book is just out. Charles Petzold is a legend in Windows world, most of the developers I know learned Windows programming (using C/C++ and the Win32 API) from his book.
Well, I am happy to report that Charles’ book Application = Markup + Code is great. Unlike Sells’ book that mainly deals with markup (XAML), Charles spends half of the book using just C# code to produce WPF apps. It makes sense to focus more on XAML as it is less familiar to the average C# developer. However, showing you C# code gives you great second perspective on the way WPF works and if anything, after seeing long and convoluted segments of code that prepare control templates, you will only appreciate XAML’s terseness more.
You don’t have to have a book to evaluate it! The code samples are available and they work with RC1 release of Windows Vista and .NET 3.0 runtime (that has to be installed on Windows XP machines). Check them out – they’re great. The book is very long, but there’s a lot of code inside and the topics get more complicated progressively and slowly. The approach is much alike bottom-up – larger blocks of functionality get built from smaller ones.
Charles builds several useful WPF utilities during the course of the book but I find his “Dump Control Template” the best – not only have I not seen anything like it from other authors, the utility is extremely useful: it shows you exactly how Microsoft built the “built-in” controls like slider (on the picture to the right, quite a complicated one!), progress bar, button…
If for some reason you must choose only one book on WPF, you should choose Petzold’s. Otherwise, buy them all (I know I will). As I’ve said before, it’ll take some time until this technology sinks in and you’ll need all the help you can get.
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
I finally got to upgrading the beta 2 of Windows Vista to RC1 last weekend. I did expect it to be better and based on many blog posts I also expected it to be quite faster.
But I did not expect the speed improvement I found. You have to see it to believe it. Occasionally it feels significantly faster than my current Windows XP Pro!
Besides from that, I have noticed improved networking in general – beta 2 worked fine with my wireless card, except when it didn’t
but RC1 just works. Boot times are still not as good as with XP but once Vista loads it flies.
Finally, a big disappointment – the processor throttling (aka SpeedStep on older Intel mobile processors) is still not working on my Intel Pentium-M (Dothan, 2 years old now). For an RC1, this is inexcusable.
Oh, yeah – the Flip3D (3D ALT-TAB replacement that stacks windows of open apps in 3D) looks significantly better, probably due to better anti-aliasing algorithm.
I have not had any crashes and all of my hardware works fine, but it was fine with beta 2 as well.
All in all, a must-have upgrade for beta 2 users. For others… well, if you’re not developing software for Vista, I see no reason to rush and install this.
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
I should have known that speaking about Vienna so many times to my wife will eventually lead to us having a short vacation there.
Last month my wife finally found a decent flight from Nice to Vienna (direct flights were unreasonably expensive before). We spent wonderful 5 days there, the weather was still good (middle September) and we saw a lot of places some of which were new to me.
The picture on the right is from Schonbrun Palace, luxurious “summer house” for the Habsburg rulers. It’s even more impressive when you see it live.
Vienna is full of places like this. There’s enough to keep you “busy” for days, just by walking in the center of the city. Castles, museums, expositions… many of them are hundreds of years old. We spent almost an hour just going through the silver collection of the royal family!
Highly recommended as a tourist destination.
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
Those fortunate to remember the 1999 and the nice part of the .com boom (insane salaries, expensive conferences, state of the art offices and hardware, luxurious hotels etc) probably also remember the state of the tools of the most hyped language of the time – Java.
Java was undoubtedly darling of the .com boom, as much as anything Web related. However, the tools support was relatively poor and IDEs were usable, but nothing to write home about. At the time, I was happily developing Windows MFC applications in C++ and looking from the Visual C++ (version 6 at the time) IDE standpoint, Java IDEs looked crude.
Years passed. In the meantime partly because of inability to “embrace and extend” Java, Microsoft came up with the .NET. Visual Studio continued to evolve and I switched to C#. Java IDEs evolved too, I just wasn’t aware of how much.
Then in early 2004, Maksa, a friend of mine and at the time long-time Java developer sent me an email that goes something like this
Hey, have you seen Resharper? It almost brings Visual Studio up to a par with Eclipse. Go check it out!
Almost? I couldn’t believe it. From my point of view, still heavily influenced by the memories of cruddy IDEs of the ‘90s, Java IDE could never be as good as Visual Studio.
However, I have recently used Eclipse quite a lot and I can finally see what Maksa meant. At the time of his email, Visual Studio (2003) was nowhere near Eclipse as an IDE (for the respective “primary” languages, Java and C#). Version 2005 of Visual Studio improved a lot, but Eclipse is still generally better – only when you install Resharper or a similar add-in you’ll get the same kind of experience.
Not all is great with Eclipse though. I still don’t get their idea of “project” and the perspectives don’t always switch back and forth the way I would expect them too, but on average as a Java IDE (and a free one too!) it is really good.
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5