1 /***
2 *
3 */
4 package org.telscenter.pas.common.ui.panel;
5
6 import java.awt.Dimension;
7 import java.awt.Rectangle;
8
9 import javax.swing.JPanel;
10 import javax.swing.Scrollable;
11
12 /***
13 * @author aperritano
14 *
15 */
16 public class ScrollablePanel extends JPanel implements Scrollable {
17
18
19
20
21 public Dimension getPreferredScrollableViewportSize() {
22
23 return this.getPreferredSize();
24 }
25
26
27
28
29 public int getScrollableBlockIncrement(Rectangle visibleRect,
30 int orientation, int direction) {
31
32 return 10;
33 }
34
35
36
37
38 public boolean getScrollableTracksViewportHeight() {
39
40 return false;
41 }
42
43
44
45
46 public boolean getScrollableTracksViewportWidth() {
47
48 return true;
49 }
50
51
52
53
54 public int getScrollableUnitIncrement(Rectangle visibleRect,
55 int orientation, int direction) {
56
57 return 10;
58 }
59
60 }