Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / July 2006

Tip: Looking for answers? Try searching our database.

JPanel separators

Thread view: 
Brandon McCombs - 22 Jul 2006 00:28 GMT
I need to create some separators in a JPanel to separate buttons and
textfields and someone on here a few days ago said to just use a
JSeparator and add it to the JPanel. I did that and the separator
doesn't show up.

This is what I'm using:
panel.add(new JSeparator(0));

Other textfields, labels, and buttons I'm adding show up just fine but
the separator isn't so the rest of my code should be okay.

any ideas?
Lee Weiner - 22 Jul 2006 01:01 GMT
>I need to create some separators in a JPanel to separate buttons and
>textfields and someone on here a few days ago said to just use a
[quoted text clipped - 8 lines]
>
>any ideas?

You need to use .setPreferredSize() to give the separator a length greater
than 0.

Lee Weiner
lee AT leeweiner DOT org
Brandon McCombs - 26 Jul 2006 04:00 GMT
>> I need to create some separators in a JPanel to separate buttons and
>> textfields and someone on here a few days ago said to just use a
[quoted text clipped - 14 lines]
> Lee Weiner
> lee AT leeweiner DOT org

OK that worked. it was nice of the sun docs to (not) mention that.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.