check for null
add layout system
optimize the rest
finish FlowLayout