How to make this sort of frame with SWING

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Jan 2008
Posts: 27
Reputation: Spartan552 is an unknown quantity at this point 
Solved Threads: 0
Spartan552 Spartan552 is offline Offline
Light Poster

How to make this sort of frame with SWING

 
0
  #1
Oct 26th, 2008
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/image..._photo_gui.jpg (the frame surrounding "Joystick information" section) and http://bp3.blogger.com/_45gEBj4xUTA/...20/RobotUI.jpg (the frame surrounding "Current data" section). I dont know how to get the same thing. Hope you can help !
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 806
Reputation: darkagn has a spectacular aura about darkagn has a spectacular aura about darkagn has a spectacular aura about 
Solved Threads: 110
darkagn's Avatar
darkagn darkagn is offline Offline
Practically a Posting Shark

Re: How to make this sort of frame with SWING

 
0
  #2
Oct 26th, 2008
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.
There are no stupid questions, only those too stupid to ask for help.
echo is a web developer's best friend.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 27
Reputation: Spartan552 is an unknown quantity at this point 
Solved Threads: 0
Spartan552 Spartan552 is offline Offline
Light Poster

Re: How to make this sort of frame with SWING

 
0
  #3
Oct 26th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,267
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 493
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: How to make this sort of frame with SWING

 
-1
  #4
Oct 26th, 2008
Why you not using TitledBorder as darkang suggested? They are easy to use, see the tutorial here
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 27
Reputation: Spartan552 is an unknown quantity at this point 
Solved Threads: 0
Spartan552 Spartan552 is offline Offline
Light Poster

Re: How to make this sort of frame with SWING

 
0
  #5
Oct 26th, 2008
Sorry I missunderstood what darkagn meant. Anyway now Im using TitledBorder and everything is fine. Thank you both for your help.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum


Views: 557 | Replies: 4
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC