Package java.awt

Examples of java.awt.ScrollPane$PeerFixer


            GridBagConstraints c = new GridBagConstraints();
           
            Panel panel = new Panel();
            panel.setLayout( gridBag );
           
            ScrollPane scrollPane = new ScrollPane();
            scrollPane.add( panel );
            scrollPane.getHAdjustable().setUnitIncrement( 20 );
            scrollPane.getVAdjustable().setUnitIncrement( 20 );
           
            setLayout( new BorderLayout() );
            add( scrollPane, BorderLayout.CENTER );
           
            buildCommand( panel, gridBag, c, "Stop(0)", "stop0",
View Full Code Here


            }
            appendException(exception, 0, buf, details);
            Component message;
            if (details) {
                MultilineLabel text = new MultilineLabel(buf.toString());
                message = new ScrollPane(ScrollPane.SCROLLBARS_AS_NEEDED);
                message.setSize(new Dimension(520, 400));
                ((ScrollPane) message).add(text);

            } else {
                message = new MultilineLabel(buf.toString());
View Full Code Here

        // TODO Auto-generated constructor stub
    }

    public Object createComponentInstance(Object parent, DomNode element)
    {
        ScrollPane pane = new ScrollPane();
        return pane;
    }
View Full Code Here

                }
            };
            ch.setSize(150, 150);
            add(ch, "Center");

            final ScrollPane sp = new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS);
            final Panel p = new Panel();
            p.add(new Button("Stop"));
            p.add(new Button("evil"));
            p.add(new Button("hoarders"));
            p.add(new Button("use"));
            p.add(new Button("GNU!"));

            sp.add(p);
            add(sp, "South");

            Panel east_panel = new Panel();
            east_panel.setLayout(new GridLayout(0, 1));

            CheckboxGroup group = new CheckboxGroup();
            Checkbox cb = new Checkbox("one", group, true);
            east_panel.add(cb);
            cb = new Checkbox("two", group, false);
            east_panel.add(cb);

            add(east_panel, "East");

            final Button wb = new Button();
            wb.setLabel("Hello World!");
            wb.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    l.setText("Hello World!");

                    final Dialog d = new Dialog(parent);
                    d.setLayout(new FlowLayout());
                    d.setModal(true);
                    Button b = new Button("foobar");
                    b.addMouseListener(new MouseAdapter() {
                        public void mousePressed(MouseEvent me) {
                            d.setVisible(false);
                        }
                    });
                    d.add(b);

                    List ch = new List();
                    ch.add("Ding");
                    ch.add("September");
                    ch.add("Red");
                    ch.add("Quassia");
                    ch.add("Pterodactyl");
                    d.add(ch);

                    d.pack();
                    d.setVisible(true);
                }
            });

            wb.addMouseListener(new MouseAdapter() {
                public void mousePressed(MouseEvent e) {
                    xs++;
                    ys++;
                    ch.repaint();
                }
            });

            add(wb, "West");

            pack();
            setVisible(true);

            sp.setScrollPosition(10, 0);

            Toolkit t = Toolkit.getDefaultToolkit();
            t.beep();
        }
View Full Code Here

   PopupMenu g5 = new PopupMenu();
   harness.check(g5.getName(), "popup3");
   harness.check(g4.getName(), "popup4");
   harness.check(g3.getName(), "popup5");
  
   ScrollPane h0 = new ScrollPane();
   ScrollPane h1 = new ScrollPane();
   ScrollPane h2 = new ScrollPane();
   harness.check(h0.getName(), "scrollpane0");
   harness.check(h1.getName(), "scrollpane1");
   harness.check(h2.getName(), "scrollpane2");
   ScrollPane h3 = new ScrollPane();
   ScrollPane h4 = new ScrollPane();
   ScrollPane h5 = new ScrollPane();
   harness.check(h5.getName(), "scrollpane3");
   harness.check(h4.getName(), "scrollpane4");
   harness.check(h3.getName(), "scrollpane5");

   TextField i0 = new TextField();
   TextField i1 = new TextField();
View Full Code Here

public class testSetLayout implements Testlet
{

  public void test(TestHarness harness)
  {
    ScrollPane pane = new ScrollPane();
   
    boolean fail = false;
    try
      {
        pane.setLayout(null);
      }
    catch (AWTError e)
      {
        fail = true;
      }
    harness.check(fail);
   
    fail = false;
    try
      {
        pane.setLayout(new BorderLayout());
      }
    catch (AWTError e)
      {
        fail = true;
      }
View Full Code Here

   */
  public void test(TestHarness harness)
  {
    setBackground(Color.red);
    Frame f = new Frame();
    ScrollPane c = new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS);
    add(c);
    f.add(this);
    f.pack();
    f.show();
    Rectangle bounds = c.getBounds();
    Insets i = f.getInsets();
    Point loc = f.getLocationOnScreen();
    loc.x += i.left + bounds.x;
    loc.y += i.top + bounds.y;
    bounds.width -= (i.left + i.right);
View Full Code Here

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

public class paramString implements Testlet
{

  public void test(TestHarness harness)
  {
    ScrollPane sp = new ScrollPane();
    ScrollPaneAdjustable vspa = (ScrollPaneAdjustable) sp.getVAdjustable();
    ScrollPaneAdjustable hspa = (ScrollPaneAdjustable) sp.getHAdjustable();
    harness.check(vspa.paramString(),
             "vertical,[0..0],val=0,vis=0,unit=1,block=1,isAdjusting=false");
    harness.check(hspa.paramString(),
             "horizontal,[0..0],val=0,vis=0,unit=1,block=1,isAdjusting=false");
  }
View Full Code Here

    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

TOP

Related Classes of java.awt.ScrollPane$PeerFixer

Copyright © 2018 www.massapicom. 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.