19.09.2015 Views

Prentice.Hall.Introduction.to.Java.Programming,.Brief.Version.9th.(2014).[sharethefiles.com]

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

+createBevelBorder(type: int): Border<br />

javax.swing.BorderFac<strong>to</strong>ry<br />

+createBevelBorder(type: int, highlight: Color, shadow: Color): Border<br />

+createBevelBorder(type: int, highlightOuter: Color, highlightInner: Color, shadowOuter:<br />

Color, shadowInner: Color): Border<br />

+createCompoundBorder(): CompoundBorder<br />

+createCompoundBorder(outsideBorder: Border, insideBorder: Border):<br />

CompoundBorder<br />

+createEmptyBorder(): Border<br />

+createEmptyBorder(<strong>to</strong>p: int, left: int, bot<strong>to</strong>m: int, right: int): Border<br />

+createEtchedBorder(): Border<br />

+createEtchedBorder(highlight: Color, shadow: Color): Border<br />

+createEtchedBorder(type: int): Border<br />

+createEtchedBorder(type: int, highlight: Color, shadow: Color): Border<br />

+createLineBorder(color: Color): Border<br />

+createLineBorder(color: Color, thickness: int): Border<br />

+createLoweredBevelBorder(): Border<br />

+createMatteBorder(<strong>to</strong>p: int, left: int, bot<strong>to</strong>m: int, right: int, color: Color): MatteBorder<br />

+createMatteBorder(<strong>to</strong>p: int, left: int, bot<strong>to</strong>m: int, right: int, tileIcon: Icon): MatteBorder<br />

+createRaisedBevelBorder(): Border<br />

+createTitledBorder(border: Border): TitledBorder<br />

+createTitledBorder(border: Border, title: String): TitledBorder<br />

+createTitledBorder(border: Border, title: String, titleJustification: int, titlePosition: int):<br />

TitledBorder<br />

+createTitledBorder(border: Border, title: String, titleJustification: int, titlePosition: int,<br />

titleFont: Font): TitledBorder<br />

+createTitledBorder(border: Border, title: String, titleJustification: int, titlePosition: int,<br />

titleFont: Font, titleColor: Color): TitledBorder<br />

+createTitledBorder(title: String): TitledBorder<br />

Figure 37.19<br />

BorderFac<strong>to</strong>ry contains the static methods for creating various types of<br />

borders.<br />

For example, <strong>to</strong> create an etched border, use the following statement:<br />

Border border = BorderFac<strong>to</strong>ry.createEtchedBorder();<br />

NOTE<br />

NOTE<br />

All the border classes and interfaces are grouped in the<br />

package javax.swing.border except javax.swing.BorderFac<strong>to</strong>ry.<br />

Borders and icons can be shared. Thus you can create a border<br />

or icon and use it <strong>to</strong> set the border or icon property for any<br />

GUI <strong>com</strong>ponent. For example, the following statements set a<br />

border b for two panels p1 and p2:<br />

***End of NOTE<br />

p1.setBorder(b);<br />

p2.setBorder(b);<br />

33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!