Package java.awt

Examples of java.awt.TextField$AccessibleAWTTextField


        });

        add(cb1, BorderLayout.EAST);
        cb1.setBackground(Color.WHITE);

        final TextField tf = new TextField();
        tf.setText("Let's type here");
        add(tf, BorderLayout.SOUTH);

        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent event) {
                dispose();
View Full Code Here


        TextField text;

        public void init() {
            initted = true;
            text = new TextField("hello world");
            add(text, "North");

            Panel p = new Panel();
            p.setLayout(new GridLayout(3, 1));
            ((GridLayout) p.getLayout()).setHgap(5);
View Full Code Here

@SuppressWarnings("serial")
public class TextFieldTest extends Frame {

    public TextFieldTest() {
        super("TextFieldTest");
        final TextField tf = new TextField();
        final Button b = new Button();
        add(tf, BorderLayout.CENTER);
        add(b, BorderLayout.EAST);
    }
View Full Code Here

            public void actionPerformed(ActionEvent event) {
                DialogTest.this.dispose();
            }

        });
        add(new TextField(), BorderLayout.CENTER);
        add(ok, BorderLayout.EAST);

        setSize(200, 100);
    }
View Full Code Here

   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();
   TextField i2 = new TextField();
   harness.check(i0.getName(), "textfield0");
   harness.check(i1.getName(), "textfield1");
   harness.check(i2.getName(), "textfield2");
   TextField i3 = new TextField();
   TextField i4 = new TextField();
   TextField i5 = new TextField();
   harness.check(i5.getName(), "textfield3");
   harness.check(i4.getName(), "textfield4");
   harness.check(i3.getName(), "textfield5");
  
   harness.check((new Cursor(0)).getName(), "Default Cursor");
   harness.check((new Cursor(1)).getName(), "Crosshair Cursor");
View Full Code Here

public class setSelectionStart implements Testlet
{

  public void test(TestHarness harness)
  {
    TextComponent textComp = new TextField();

    // Check that default value is correct.
    harness.check(textComp.getSelectionStart(), 0);
    harness.check(textComp.getSelectionEnd(), 0);
   
    // Check behaviour when setting text.
    textComp.setText("This is some text.");
    harness.check(textComp.getSelectionStart(), 0);
    harness.check(textComp.getSelectionEnd(), 0);
   
    // Check behaviour when start < 0.
    textComp.setSelectionStart(-6);
    harness.check(textComp.getSelectionStart(), 0);
    harness.check(textComp.getSelectionEnd(), 0);
   
    // Check behaviour when start = end
    textComp.setSelectionStart(0);
    harness.check(textComp.getSelectionStart(), 0);
    harness.check(textComp.getSelectionEnd(), 0);
   
    // Check behaviour when start > end
    textComp.setSelectionStart(13);
    harness.check(textComp.getSelectionStart(), 13);
    harness.check(textComp.getSelectionEnd(), 13);
   
    // Check behaviour when start < end
    textComp.setSelectionStart(9);
    harness.check(textComp.getSelectionStart(), 9);
    harness.check(textComp.getSelectionEnd(), 13);

  }
View Full Code Here

  boolean mouseExit = false;
 
  public void test(TestHarness harness)
  {
    this.harness = harness;
    a = new TextField(5);
    b = new TextArea(10, 10);
    add(a, BorderLayout.EAST);
    add(b, BorderLayout.WEST);
    setSize(200,200);
    show();
View Full Code Here

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

 
  public void test1(TestHarness harness)
  {
    // Test getMinimumSize() method.
   
    TextField field = new TextField();
    harness.check(field.getSize(), new Dimension());
    harness.check(field.getMinimumSize(), new Dimension());
   
    // Check that if mininum size has not been set, then a
    // Dimension with current number of rows and columns
    // is returned.
    harness.check(field.isMinimumSizeSet(), false);
    field.setSize(new Dimension(4, 8));
    harness.check(field.getMinimumSize(), new Dimension(4, 8));
       
    // Check that if minimum size has been set,
    // then those values are returned.
    Dimension minSize = new Dimension(5, 16);
    field.setMinimumSize(minSize);
    harness.check(field.isMinimumSizeSet());
    harness.check(field.getMinimumSize() != minSize);
    harness.check(field.getMinimumSize(), minSize);
  }
View Full Code Here

 
  public void test2(TestHarness harness)
  {
    // Test getMinimumSize(int, int) method.
   
    TextField field = new TextField();
   
    // Show that if the values passed are <=, ==, >= or negative,
    // then no exceptions are thrown.
    harness.check(field.getSize(), new Dimension());
    harness.check(field.getMinimumSize(7), new Dimension());
    harness.check(field.getMinimumSize(0), new Dimension());
    harness.check(field.getMinimumSize(-7), new Dimension());
       
    // Check that if minimum size not been set, then a
    // Dimension with size (width, height) is returned.
    harness.check(field.isMinimumSizeSet(), false);
    field.setSize(new Dimension(3, 4));
    harness.check(field.getMinimumSize(2), new Dimension(3, 4));
   
    // Check that if minimum size has been set, then a
    // those values are returned.
    field.setSize(new Dimension(-3, 5));
    harness.check(field.getSize(), new Dimension(-3, 5));
    field.setMinimumSize(new Dimension(1, 9));
    harness.check(field.isMinimumSizeSet());
    harness.check(field.getMinimumSize(1), new Dimension(1, 9));
  }
View Full Code Here

TOP

Related Classes of java.awt.TextField$AccessibleAWTTextField

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.