Trapped interacting two-component bosons in one dimension