My previous posting “Using Bluetooth stack in desktop application” was quite a success if measured by the number of comments. It seems that there aren’t many tutorials or articles about the Desktop usage of Bluetooth.
Here is a next chapter in the same category: using Bluetooth to send files from a computer to a mobile phone.
I’ve been coding dashboard applications lately with Java SE. I have used JFreeChart library to generate all pie, line and bar charts. The library is awesome and is also Open Source. It would be very nice to see similar projects in the .NET world.
It was very easy to create first charts with JFreeChart mostly because it is so commonly used so there are many resources available in the Internet including tutorials and tips&tricks.
Here is a small sample how to create a simple pie chart and use it in your Swing application:
// First create dataset
DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("Finland", 5300367);
dataset.setValue("Sweden", 9107649);
dataset.setValue("Norway", 4606363);
dataset.setValue("Denmark", 5427459);
dataset.setValue("Iceland", 309699);
// Create chart using the ChartFactory
JFreeChart chart = ChartFactory.createPieChart(
"the Nordic countries", // Title
dataset, // Dataset
false, // Don’t show legend
false,
false);
The following code adjusts chart appearance and section colors. This is not mandatory but shows how easily you can customize the visual parts of the chart.
That is all you have to do to create a chart object. Then if you wish to display this chart for example in your Swing application you’ll need to do the following: