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 !

9 Years
Discussion Span
Last Post by Spartan552

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.


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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.