28.12.2012 Views

Core JFC Java Foundation Classes 2nd edition - Read

Core JFC Java Foundation Classes 2nd edition - Read

Core JFC Java Foundation Classes 2nd edition - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

656 Chapter 6 Menus and Toolbars<br />

Figure 6-10 A menu with icons.<br />

In <strong>Java</strong> 2, menus and menu bars are affected by their component orientation<br />

attribute in just the same way as the AbstractButton class from which<br />

they are derived (see Chapter 2 for a full discussion of component orientation<br />

and buttons). You'll see all of the implications of this in "Menus and<br />

Component Orientation" later in this chapter. As with buttons, you can use<br />

the constants TRAILING and LEADING to allow the decision as to whether to<br />

place the icon to the left or right of the text to be made based on the locale in<br />

which the application is run.<br />

The text on the menu items can also be made to appear directly underneath<br />

the corresponding images, as you can see in Figure 6-11. This is not, of

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

Saved successfully!

Ooh no, something went wrong!