Hello everybody,

I have various components that I want regroup in the same category. I found numerous screenshots on the internet using some sort of frame surrounding items. For instance : http://www.vieartificielle.com/images_robot/e70d6615e7b9c9ecfacdc7e977425d6d/cache_500_wifi_robot_photo_gui.jpg (the frame surrounding "Joystick information" section) and http://bp3.blogger.com/_45gEBj4xUTA/RwefQvOgIjI/AAAAAAAAACQ/pKezYz2qQCQ/s320/RobotUI.jpg (the frame surrounding "Current data" section). I dont know how to get the same thing. Hope you can help !

Recommended Answers

All 4 Replies

Put all of your components that you want to group into a JPanel and set a border around it. Something like TitledBorder should suffice, although if you want to get really fancy try a CompoundBorder. Then you just add the JPanel to your JFrame where you want.

k... So I just have to use a bordered JPanel. I guess I will have to drag a JLabel on the top of the border to make it look like the picture. Thank you for your help.

Why you not using TitledBorder as darkang suggested? They are easy to use, see the tutorial here

Sorry I missunderstood what darkagn meant. Anyway now Im using TitledBorder and everything is fine. Thank you both for your help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.