How to cite a web site - 796 Graphical User Interface Components: Part 2 Chapter
796 Graphical User Interface Components: Part 2 Chapter 13 The horizontal and vertical scrollbar policies for a JScrollPane are set when a JScroll- Pane is constructed or with methods setHorizontalScrollBarPolicy and setVerticalScrollBarPolicy of class JScrollPane. A JPanel can be used as a dedicated drawing area that can receive mouse events and is often extended to create new GUI components. Swing components that inherit from class JComponent contain method paintComponent, which helps them draw properly in the context of a Swing GUI. JComponentmethod paint- Component should be overridden to call to the superclass version of paintComponent as the first statement in its body. Classes JFrameand JApplet are not subclasses of JComponent; therefore, they do not contain method paintComponent(they have method paint). Calling repaint for a Swing GUI component indicates that the component should be painted as soon as possible. The background of the GUI component is cleared only if the component is opaque. Most Swing components are transparent by default. JComponentmethod setOpaque can be passed a boolean argument indicating whether the component is opaque (true) or transparent (false). The GUI components of package java.awt are different from Swing components in that repaint results in a call to Component method update (which clears the component s background) and update calls method paint (rather than paintComponent). Method setTitle displays a String in a window s title bar. Drawing on any GUI component is performed with coordinates that are measured from the upper- left corner (0, 0) of that GUI component. Layout managers often use a GUI component s getPreferredSizemethod to determine the preferred width and height of a component when laying out that component as part of a GUI. If a new component has a preferred width and height, it should override method getPreferred- Size to return that width and height as an object of class Dimension (package java.awt). The default size of a JPanel object is 0 pixels wide and 0 pixels tall. A mouse drag operation begins with a mouse-pressed event. All subsequent mouse drag events (for which mouseDragged will be called) are sent to the GUI component that received the original mouse-pressed event. JSliders enable the user to select from a range of integer values. JSliders can display major tick marks, minor tick marks and labels for the tick marks. They also support snap-to ticks, where positioning the thumb between two tick marks causes the thumb to snap to the closest tick mark. Most Swing GUI components support user interactions through both the mouse and the keyboard. If a JSlider has the focus, the left arrow key and right arrow key cause the thumb of the JSlider to decrease or increase by 1. The down arrow key and up arrow key also cause the thumb of the JSlider to decrease or increase by 1, respectively. The PgDn key (page down) and PgUp key (page up) cause the thumb of the JSliderto decrease or increase by block increments of one-tenth of the range of values, respectively. The Home key moves the thumb to the minimum value of the JSlider and the End key moves the thumb to the maximum value of the JSlider. JSliders have either a horizontal orientation or a vertical orientation. For a horizontal JSlider, the minimum value is at the extreme left and the maximum value is at the extreme right of the JSlider. For a vertical JSlider, the minimum value is at the extreme bottom and the maximum value is at the extreme top of the JSlider. The relative position of the thumb indicates the current value of the JSlider. Method setMajorTickSpacing of class JSlider sets the spacing for tick marks on a JSlider. Method setPaintTickswith a trueargument indicates that the tick marks should be displayed.
Note: In case you are looking for affordable webhost to host and run your web application check Vision http web server services