The Kinetic Scrolling component will be released very very soon but I ran into something exciting that I want to share with you:
1. DebugGraphics is a Swing class that can really help when debugging your Swing applications. It supports three different modes: Buffered_Option (Show buffered operations in a separate Frame), Flash_Option (Flash graphics operations) and Log_Option (Log graphics operations).
I’ve tried the Flash_Option and efter some fine tuning of the DebugGraphics object (invoked setFlashColor and setFlashTime) I saw some easy to understand debug painting on the screen. All it does is flashing the next draw operation in a user defined color before painting the real operation. Neat.
2. Next is not that exiting (and if you thought the previous one was then your as big a geek as I am) but at JFokus we got a question about JPanel and JComponent. We were talking about how to create your own component and said that you should override JComponent when someone asked why we didn’t override JPanel instead. Well we didn’t really know and to be honest we did just that in the beginning but switched to JComponent because it felt better. Anyway, the reason for using JComponent instead of JPanel is really simple: JPanel is meant to be used as a container for other components and because of that contains some extra logic for handling children. If you don’t want any overhead don’t use JPanel when writing your own component.
3. Have you read Swing links of the week by Kirill Grouchnikov? If not you’ve missed something. A month ago he decided to stop writing the much appreciated Swing links posts due to limited time. Nothing to do about it but the good news are that a guy named Jonathan Giles picked up the thread and are now writing Swing links of the week. Thank you. You can find his blog at http://www.jogiles.co.nz/blog/
4. Tip of the day: if you already haven’t, open the JComponent API and go through the methods and I promise that you will find a new useful method everytime you do. At least I do.
5. Do you know what happends when you press Ctrl-Shift-F1 when running a Swing application? You don’t? It prints out all information about all component in the visible Frame. LayoutManager, position, text values and everything else you might (or might not) want to know.
That’s it.
Recent comments