Click the arrow buttons on the scroll bars.The units on the row and column headers change to inches (or back to centimeters). Click the cm toggle in the upper left corner of the scroll pane.If you have a mouse with a wheel (which is generally between the mouse buttons) use the mouse wheel to scroll the image vertically.Watch the image scroll and the horizontal and vertical rulers scroll along. Alternatively, to compile and run the example yourself, consult the example index. Java™ Web Start ( download JDK 7 or later). Click the Launch button to run ScrollDemo using. The scroll pane also has two scroll bars, a row header, a column header, and four corners, three of which have been customized. Rather than displaying text, this scroll pane contains a image. The scroll pane in this application looks very different from the one in the previous demo program. Here is a snapshot of an application that uses a customized scroll pane to view a photograph: The rest of this section discusses the following topics: Refer to Sizing a Scroll Pane for information about techniques for making a scroll pane the size you want. If we didn't restrict the size of the scroll pane's container, the scroll pane would be big enough for the text area to display the full 5 rows and 30 columns specified with the JTextArea constructor. In the Java look and feel, this preferred size happens to be a bit less tall than required for the text area to display the 5 rows that we requested when creating it, so the scroll bar initially displays a vertical scroll bar. You might have noticed that the preceding code sets the preferred size of the scroll pane's container. The program doesn't invoke any methods on the JScrollPane object, since the scroll pane handles everything automatically: creating the scroll bars when necessary, redrawing the client when the user moves the scroll knobs, and so on. The boldface line of code creates the JScrollPane, specifying the text area as the scroll pane's client. SetPreferredSize(new Dimension(450, 110)) JScrollPane scrollPane = new JScrollPane(textArea) To increase the size of text and icons, see Make text and other items on the screen bigger.//In a container that uses a BorderLayout: To momentarily switch between scrolling methods while working, press and hold the Option key while clicking the scroll bar. Jump to the spot that’s clicked: Moves to the spot where you’re clicking for example, if you click at the bottom of the scroll bar, you go to the bottom of the document. Jump to the next page: Clicking in the scroll bar moves the content page by page. When scrolling: Hide scroll bars until you start scrolling. If your device allows gestures, scroll bars are hidden until you start scrolling. Choose an option to control when scroll bars are shown:Īutomatically based on mouse or trackpad: Scroll bars are shown depending on the mouse or trackpad you’re using. Scroll bars appear in a window when there’s content that doesn’t fit into the window’s current size. The size of text in the sidebar also changes.Īllow colours from the wallpaper to subtly tint certain window areas, such as toolbars or status bars. See Change Night Shift settings.Īuto won’t switch the appearance until your Mac has been idle for at least a minute or if an app is preventing the display from sleeping, such as during media playback.Ĭhoose the colour to use for buttons, pop-up menus and other UI controls.Ĭhoose the colour to use for highlighting selected text.Ĭhoose small, medium or large icons for the Finder sidebar and for the sidebar in apps such as Mail, News and Photos. It’s effective for viewing documents, presentations, photos, films, web pages and more.Īuto switches the appearance from light to dark based on the Night Shift schedule you set. Light provides a light appearance that doesn’t change.ĭark provides a darkened appearance so the content you’re working on stands out while windows and controls seem to recede into the background.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |