Examples of ScrollPane


Examples of java.awt.ScrollPane

    harness.check(pane.getScrollPosition(), new Point());
  }
 
  public void test3(TestHarness harness)
  {
    ScrollPane pane = new ScrollPane();
    pane.add(new Button());
   
    // Check that setScrollPosition(int, int) and
    // setScrollPosition(Point) return the same values.
    pane.setScrollPosition(1, 1);
    harness.check(pane.getScrollPosition(), new Point(0, 0));
    pane.setScrollPosition(new Point(1, 1));
    harness.check(pane.getScrollPosition(), new Point(0, 0));
  }
View Full Code Here

Examples of java.awt.ScrollPane

    harness.check(pane.getScrollPosition(), new Point(0, 0));
  }
 
  public void test4(TestHarness harness)
  {
    ScrollPane pane = new ScrollPane();
    pane.add(new Button());

    // Check that if x or y < 0, x and y are set to 0.
    pane.setScrollPosition(-1, -1);
    harness.check(pane.getScrollPosition(), new Point());
    pane.setScrollPosition(0, 0);
    harness.check(pane.getScrollPosition(), new Point());
  }
View Full Code Here

Examples of java.awt.ScrollPane

    harness.check(pane.getScrollPosition(), new Point());
  }
 
  public void test5(TestHarness harness)
  {
    ScrollPane pane = new ScrollPane();
    Button button = new Button();
    button.setSize(100, 100);
    pane.add(button);
    harness.check(pane.getComponent(0).getWidth(), 100);
    harness.check(pane.getComponent(0).getHeight(), 100);
    harness.check(pane.getViewportSize().getWidth(), 100);
    harness.check(pane.getViewportSize().getHeight(), 100);
   
    // Check that if x > (child's width - viewport width),
    // then x is set to (child's width - viewport width) and
    // that if y > (child's height - viewport height),
    // then y is set to (child's height o veiwport height).
    int x = 100;
    int y = 100;
    int tempx = (int) (pane.getComponent(0).getWidth() -
                          pane.getViewportSize().getWidth());
    int tempy = (int) (pane.getComponent(0).getHeight() -
                          pane.getViewportSize().getHeight());
    harness.check(tempx < x);
    harness.check(tempy < y);
    pane.setScrollPosition(x, y);
    harness.check(pane.getScrollPosition().getX(), tempx);
    harness.check(pane.getScrollPosition().getY(), tempy);
   
  }
View Full Code Here

Examples of java.awt.ScrollPane

public class getScrollPosition implements Testlet
{

  public void test(TestHarness harness)
  {
    ScrollPane pane = new ScrollPane();
   
    // Check that NPE is thrown when scrollpane does have a child.
    boolean fail = false;
    try
      {
        pane.getScrollPosition();
      }
    catch (NullPointerException e)
      {
        fail = true;
      }
View Full Code Here

Examples of java.awt.ScrollPane

 
  public void test1(TestHarness harness)
  {
    // This test checks that the location of scrollpane's
    // child is "reset" to (0, 0).
    ScrollPane pane = new ScrollPane();
    Component button = new Button();
    button.setLocation(100, 250);
    pane.add(button);
    harness.check(button.getLocation().getX(), 100);
    harness.check(button.getLocation().getY(), 250);
    pane.doLayout();
    harness.check(button.getLocation().getX(), 0);
    harness.check(button.getLocation().getY(), 0);
  }
View Full Code Here

Examples of java.awt.ScrollPane

        // Create the help dialog.
        this.setLayout(new BorderLayout());
        lblHelp = new AdvancedLabel(Messages
                .getString("CommonHelpDialog.noHelp.Message")); //$NON-NLS-1$
        ScrollPane scroll = new ScrollPane(
                java.awt.ScrollPane.SCROLLBARS_ALWAYS);
        scroll.add(lblHelp);
        this.add(scroll, BorderLayout.CENTER);

        // Add a "Close" button.
        Button butClose = new Button(Messages
                .getString("CommonHelpDialog.Close")); //$NON-NLS-1$
View Full Code Here

Examples of java.awt.ScrollPane

                int saveFill = c.fill;
                c.fill = GridBagConstraints.HORIZONTAL;

                // Place the choice area in the center
                // of another panel that is scrolled.
                ScrollPane scroller = new ScrollPane();
                Panel scrollee = new Panel(new GridBagLayout());
                scrollee.add(choiceArea, center);
                scroller.add(scrollee);
                add(scroller, c);

                // Restore the saved value of c.fill.
                c.fill = saveFill;
View Full Code Here

Examples of java.awt.ScrollPane

                int saveFill = c.fill;
                c.fill = GridBagConstraints.HORIZONTAL;

                // Place the choice area in the center
                // of another panel that is scrolled.
                ScrollPane scroller = new ScrollPane();
                Panel scrollee = new Panel(new GridBagLayout());
                scrollee.add(choiceArea, center);
                scroller.add(scrollee);
                add(scroller, c);

                // Restore the saved value of c.fill.
                c.fill = saveFill;
View Full Code Here

Examples of java.awt.ScrollPane

        c.fill = GridBagConstraints.BOTH;
        c.insets = new Insets(10, 10, 10, 10);
        c.weightx = 1.0;
        c.weighty = 0.0;
        c.gridwidth = GridBagConstraints.REMAINDER;
        ScrollPane scrollPane = new ScrollPane();
        scrollPane.add(labMessage);
        scrollPane.setSize(400, 300);
        gridbag.setConstraints(scrollPane, c);
        add(scrollPane);

        c.weightx = 1.0;
        c.weighty = 1.0;
View Full Code Here

Examples of java.awt.ScrollPane

    }

    private void addGroup(IOptionGroup group, GridBagLayout gridbag,
            GridBagConstraints c) {
        groupPanel = new Panel();
        scrOptions = new ScrollPane();

        groupPanel.setLayout(gridbag);
        scrOptions.add(groupPanel);
        scrOptions.getVAdjustable().setUnitIncrement(10);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.