Java frustrations learning Android

I have just started playing with Android and I am sorry to say its not been the greatest experience so far. When you try the examples they probably will not work because they have changed the API since. And they have not documented the changes – well, if they do, they hide it very well…

Read More

BufferedImage raster data in Java

Most of the time, the abstraction you get in Java is brilliant. It hides the complexity and lets you get on with real-life problem solving. This is especially true of the Image classes where you can forget about Tiffs, PNGs and Jpegs and just work with images. Occasionally though you need to dig deeper and…

Read More

Java Printing page size problem

Java has a very flexible printing system called JPS which makes printing very easy. Any JComponent can be made to print its contents by adding a print method public int print(Graphics graphics, PageFormat pf, int page) throws PrinterException {} When Java needs to print, it calls this method and whatever you paint onto the graphics…

Read More

Java Memory leaks with FileChannel

It is a myth that Java has no ‘memory leaks’. It is certainly much better than developing in C and many of the gotchas do not exist in Java. But there are still potential memory issues in Java. For example, we have been looking at using FileChannel. This allows the developer to have only part…

Read More