simple code example for swing