Wednesday Aug 15, 2012

YouTube: Get Started Creating Modular Data Analyzers in Java

Yesterday someone asked me the standard newbie question, along the lines of: "OK, cool, this NetBeans Platform thing seems pretty useful, but I don't 'get' it. How does everything fit together and how do I create an actual real application, just like one of those cool apps on the NetBeans Platform Showcase."

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

About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« August 2012 »
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
 
       
Today