![]() Using a titled border, you can convert any border into one that displays a text description. You need to be careful when choosing the icon and determining your component's size otherwise, the icon might get chopped off or have mismatch at the component's corners. You then specify either a color or an icon for the matte border to draw. When creating a matte border, you specify how many pixels it occupies at the top, left, bottom, and right of a component. The next picture shows some matte borders. Alternatively, to compile and run the example yourself, consult the example index. Java™ Web Start ( download JDK 7 or later). ![]() We show the code for creating these borders a little later, in Using the Borders Provided by Swing.Ĭlick the Launch button to run the BorderDemo example using The following pictures show an application called BorderDemo that displays the borders Swing provides. The rest of this page discusses the following topics: The black line drawn by the border marks the edge of the container. Here's a picture of the container, which contains a label component. ![]() tBorder(BorderFactory.createLineBorder(Color.black))
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |