This is a pretty open question, the short simple answer is that you subclass JComponent
or one of it's descendants and add the functionality that you require. Obviously, depending on what you're wanting to do this may vary in difficulty. For starters I recommend you read Sun's tutorial on using Swing components where there are examples on how to use scroll panes and popup menus. Once you have read through those and experimented you might have more specific questions that will be easier for people to provide considered answers to.
If the two components in your mock up are all you are wanting to implement then giving us some better idea of how you want them to function will yield better answers.