1 18 19 package swingwtx.swing; 20 21 import swingwt.awt.*; 22 23 29 public class JViewport extends JComponent { 30 31 JScrollPane friend = null; 32 33 protected JViewport(JScrollPane friend) { 34 this.friend = friend; 35 } 36 37 public Component add(Component c) { 38 return friend.add(c); 39 } 40 41 public Component add(String name, Component c) { 42 return friend.add(name, c); 43 } 44 45 public Component getView() { 46 return friend.getComponents()[0]; 47 } 48 49 public Point getViewPosition() { 50 return friend.getLocation(); 51 } 52 53 public Rectangle getViewRect() { 54 return friend.getBounds(); 55 } 56 57 public Dimension getViewSize() { 58 return friend.getSize(); 59 } 60 } 61 | Popular Tags |