Feed on
Posts
Comments

Swing is a very powerful Java GUI toolkit and rank among the best GUI toolkits in the market. Despite its early negative reputation as being slow and buggy, Swing has come a long way since its inception a decade ago. Each iteration of Java incorporates noticeably improvement of Swing in term of performance, stability, power and ease of use. Swing also leverages on new hardware and software capabilities like Windows DirectX, graphics hardware acceleration.  No doubt that Swing has a steep learning curve but developer who willing to spend time learning it will be rewarded with a toolkit that virtually capable of building any software imaginable, be it word processor, IDE. The future of Swing and Java2D which it built upon are promising and are the foundation of Java’s new scripting language, JavaFX.

Printing Text in JTextArea

Swing’s API has improved a great deal by making it simple to do mundane thing that once require the developer to implement. The printing facility is one area that Swing has made it easy for the developer. To print the content of text component that is subclass of JTextComponent (which defines the print method), one just need to call print method as follow. However, currently Swing does not provide a easy way to print selected text. Still with ‘creative problem solving’, there are ways to implement it just as easy. The following code is one way to implement it through using a dummy hidden text component. With some modification, the code can also be reused for JTextField, JEditorPane etc

Running the code

When code is run, it show the following,

image

Continue Reading »

image

At last, kudos to image that the playlist has once again regain its full functionality and usefulness ! Since the beginning of the year, Deezer has changed the playlist component that is almost unusable since it cannot play individual song and moreover many songs like Scorpions can no longer play due to disagreement with Universal Music company. In fact, this dilemma is highlighted in Deezer’s blog that mention the deal from respective music company forbids song to play outside France. Deezer team promises the case will be resolved and now after six months of patiently waiting, the fans’ prayers are been finally answered. Not only the playlist is back but every one of the songs in the playlist is playback with noticeably good performance, which apparently due to upgraded infrastructure. The music companies now officially allowed many of the popular songs to be playback in Deezer. The scope, breath and quality of songs (commerical song) are much wider than image (Imeem’s strength lies in user-uploaded song) and that is why I prefer Deezer as the first choice for song selection.

Even Deezer site is undergoing a facelift image

 

Yes, the music is back for good thank to Deezer and the music companies.

Long live internet music !

Many experienced programmer will lament that GOTO is a bad practice that result in Spaghetti code. Generally a GOTO statement is accompanied by a label argument that been placed within the same method and invoking GOTO will return to the preceding statement where the LABEL is located. GOTO can be a very effective tool in Java that can reduce the number of code, making it more concise and beautiful. Java does not explicitly support GOTO keyword but the BREAK statement is synonymous.

so the format is

LABEL:

{

IF statement

  BREAK LABEL;

……

IF statement

  BREAK LABEL;

……

}

Continue Reading »

Generics is a very powerful but often misunderstood enhancement to the Java language. It is available since Java5 and its addition remove the need to explicitly cast object, and also make Java programming fun, fast and safe by allowing modern IDEs like NetBeans, Intellij, Eclipse to display ‘Generics’ errors in instantly without compilation. Apparently, IDEs love statically-type language as they can take advantage of type information to perform magic like Auto-Complete, Refactoring with confidence etc.  Prior to Generics, casting errors can only be exposed during runtime rather than compile time.

http://java.sun.com/j2se/1.5.0/docs/guide/language/generics.html

Generics. Don’t program without it.

One of the common questions ask for Generics in the internet but yet hard to find is how to instantiate a Generics Type.

Continue Reading »

As of lately, I experience the same image problem that plagued WordPress.com some months back

See:

Is there a problematic update with WordPress.com ?

Beware of recent problems in WordPress.com hosted site with blogging tools.

In short, what happen is that image that hosted on the service from one post (the issue does not affect those image using external service eg Flickr. Only those image that are stored using WordPress.com ) end-up replacing another in another post. Worse is that the original image cannot be reverted back  by WordPress.com but only by user tediously doing the replacement in each affected post (Provided that he know which post is affected).

As can be seen from the following post,  images have been randomly replaced in the post.

One of the posts affected are

Tour of Singapore Attraction - Canopy Walk, Alexandra Arch, Forest Walk and Henderson Waves

As can be seen, the images of recent post replace those of other post for no apparent reason.

 

It looks like other users are experiencing the same frustration. Forum => Photo changes

Urge others not to create or update post that contains images hosted on WordPress.com until the problem is ‘officially’ resolved. As of current, the case is still opened.

I will not be rectifying any image screwup in affected posts in the meantime.

Some people like me image are just too curious to peek on stuff behind all those cool extensions of Firefox like image image , image image , imagining their files and resources will just be amazing as the extension themselves Open-mouthed.

image Well, if only life is so simple. Finding out the ‘actual’ location where these extensions are stored is not a trivial task even if one spend time searching the web for answer (try searching Google). In fact, one might initially think that the extension should be rightfully stored in Firefox’s directory especially if there is actually a ‘extensions’ directory exists within the program directory. Disappointedly, none is found there.

Anyway, let’s not test thy patience anymore. So here is the quick answer:

image

C:\Users\UserName\AppData\Roaming\Mozilla\Firefox
\Profiles\Whatever.default\extensions

eg C:\Users\burger\AppData\Roaming\Mozilla\Firefox
\Profiles\6nwxxfss.default\extensions

You know ‘Whatever’ when you reach the Profiles directory.

image

C:\Documents and Settings\UserName\Application Data
\Mozilla\Firefox\Profiles\Profile\extensions

Inside the extensions directory, one might encounter myriad of directories and files. Some files having extension like DLL, JS, JAR files. If there is JAR file, simply rename it to ZIP extension (Yes, JAR is actually a ZIP compressed file popularise by Java as Java ARchive file. Maybe to Firefox, it means Javascript ARchive File ?) and you can check what inside the container file.

image

Chris Thiessen developed Zoomii full time over the course of almost 1.5 years since December 2006.

If you know how to look for books in a bookstore then you basically know how to use Zoomii. Big Grin

 image image

Introduction

image For book lover, have you ever love the experience and thrill of casually skimming over wide range of books on the bookshelf at a glance hoping for something interesting to spontaneously catch your attention ?  If you do, you might have thought that such experience could only be found in real bookstore but not anymore since image (www.zoomii.com), a fantastic service whose mission is to bring back that kind of ‘fun’ experience on the web, has been available publicly since 16 June 2008. Simply imagine all the books in a bookstore is directly layout on a screen and available for pick and purchase, and that is exactly what the underlying concept of Zoomii is all about. Zoomii also draw its inspiration from Google Map with its all familiar navigation control for panning and zooming. Indeed, the user interface of Zoomii can be perceived as Google Map for Amazon Books. As its name implies, the concept of zooming in and out of the bookstore is the cornerstone of the service, which akin to the same physical experience of walking from one bookshelf to another to check up the book.

Given the advantage of using the lightning-fast online search that return the book information efficiently with a blink of eyes, why will one still bother to browse books in a tedious physical way ? For many, it turns out that the thrill and joy of discovering new and related book in a physical bookstore is not something a computing experience can easily replace. Many still prefer the challenge and curiosity to discover something in a raw way within a familiar and conducive physical environment that piques them further. In addition, the relaxed ambience and the environment are what make going to a bookstore fun and enjoyable.

Continue Reading »

image

At last ! The latest version of the highly-anticipated popular browser is officially launched on 17 July 2008. This also marks the day where Firefox try to break the world record as the most downloaded browser in a single day. It is a special day for image since the last major version 2.0 was released almost two years ago. Apparently nothing much is changed from the outlook, however under the hood, Firefox undergoes serious overhaul in its architecture which results in faster performance and lower memory consumption. It feels snappier and load fast. In fact, Firefox is so successful in retaining its original look that one might thought that there is nothing significant to awe about. But look is deceptive. The first noticeable enhancement is the instant URL search that now show bookmark entries as well.

However, there are few caveats. Users have to beware if they rely on extension. Certain Firefox extensions no longer works anymore and Firefox intelligently detect the incompatible extension and render them in-activatable.  Aside from these, I puzzle why Firefox still lack a slider zoom that will come in handy for viewing flash video and image. Third-party extensions might have provided such functionality but it doesn’t hurt to include this as a standard feature either.

 

image Firefox is definitely not a minor upgrade and users will fervently want to explore every features of this release. However the Firefox site only provide a brief overview of its new and improved features http://www.mozilla.com/en-US/firefox/features/. To supplement more information, SitePoint, a book publisher, has generously offered a free guide entitled Firefox 3 REVEALED downloadable from the site http://www.sitepoint.com/books/firefox3/. This 1.2mb pdf ebook contains 30 pages of information covering on the latest Firefox release. So why not start exploring Firefox with the help of companion guide now.

Geezer:  When I’m With You (LB2)

 

image

image

imageAlias was an hard rock band fronted by the vocalist Freddy Curci who is renowned for his multi-octave singing range and his Guinness World Record for Longest Note Held in his Number 1 Single in “When I’m With You“.

After his debut group Sheriff was disbanded, he formed another group, Alias, whose famous hit is the power ballade More than words can say. image

Continue Reading »

image

Sometimes a walk in the Reservoir is a invigorating experience. The tranquility and simplicity of the place is a good way to escape from the hectic and busy life in Singapore. I just like visiting Pandan Reservoir because the vast view of clean sparkling water is relaxing and revitalizing. What can be more enjoyable than to walk in the 6km reservoir under the sun while breezing by the cool wind. Oh, it is a good way to make a lobster out of yourself too.

SlideShow

Video shot

Continue Reading »

« Newer Posts - Older Posts »