A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Swing / AWT / SWT
Setting the JFrame contentpane's border
Joined: Sep 15, 2003
Mar 26, 2004 12:08:00
Is there a way to create an empty border on the
's contentpane, so that when I add components to it the will not be placed flushed with the sides? I would like to do this without having to add a
to the contentpane first. Thank you.
Joined: Oct 18, 2000
Mar 29, 2004 10:40:00
All you have to do is cast the content pane to a
and set the border...
((JComponent)getContentPane()).setBorder( BorderFactory.createMatteBorder( 10, 10, 10, 10, Color.blue ) );
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
rocket mass heater
subject: Setting the JFrame contentpane's border
sockets in applet
Problems with GUI
Centering a JComponent in the CENTER area of BorderLayout?
how to set this a borderq
Checking input in Dialog box before closing
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013