By Geertjan on Aug 15, 2012
Well, in all honesty, there are heaps of tutorials on the NetBeans Platform Learning Trail, including end to end tutorials, i.e., including tutorials for complete applications. However, this particular user had a scenario in mind that is only partly covered in the New File Type Tutorial. He wanted to understand a scenario where (1) he should be able to manage his own file type, (2) programmatically read and write data from a file of the type, and (3) display the data in various ways in different windows.
So I created a new YouTube movie, covering about 42 minutes, which puts most of the topics above together. It's not perfect, if I'd do it again I'd change a few things, but anyway, he found it useful, so here it is:
Today I took the example a bit further. Now there are three windows in total, i.e., the editor plus two independent TopComponents, all of which are synchronized. Any change in any of these windows enables the Save action which, when invoked, saves the changes in the current window into the file, which is then pushed into the Lookup so that the other windows are updated with the new data:
What's the point of this scenario? Well, imagine that one of the windows above represents the data as colors, while one of the other windows represents the data in a chart. The key to all of that is the communication between these windows, since they come from different modules, which is what this sample illustrates. With the above knowledge, it's up to you to change the representation however you like, i.e., use JFreeChart or JavaFX or whatever. But the basis, before you get to the visualizations, is setting up the architecture, window system, and communication layer, all of which are provided by this sample.
If anyone is interested in the sources of the above, or in a part 2 of the screencast above, feel free to let me know in the comments of this blog entry.
Funny Moment of the Day. Elsewhere on YouTube, watch this hilarious clip, featuring an awesome Tom Cruise and Arnold Schwarzenegger impression: http://www.youtube.com/watch?v=zS1Aee2X3Yc