CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: TextField

  1. #1
    Join Date
    Mar 1999
    Posts
    5

    TextField



    Can I create a TextField and TextArea in a frame? I want to create an application.

    I want to create a dialog box. Ask the user for user_id, password and URL,connect to the database and

    authenticate it. I am using JDBC driver and JDK 1.2.

  2. #2
    Join Date
    Mar 1999
    Posts
    3

    Re: TextField



    Hi Gauri,


    Ya offcourse u can.

    U can find this in any tutorials - how to add TextFields and TextArea in a Frame

    or Dialog. If not let me know.


    One of the good resources is sun java tutorials. try sun site.


    ..praks

  3. #3
    Join Date
    Mar 1999
    Posts
    9

    Re: TextField



    Hi Gauri,

    class Frame1 extend Frame

    {

    Frame1()

    {

    ...

    ...

    // this code

    textField1 = new java.awt.TextField();

    // u could use a layoutmanager to skip the foll. code line

    textField1.setBounds(insets().left + 240,insets().top + 60,137,30);

    add(textField1);

    textArea1 = new java.awt.TextArea();

    // u could use a layoutmanager to skip the foll. code line

    textArea1.setBounds(insets().left + 240,insets().top + 120,149,58);

    add(textArea1);

    .....

    }


    // to connect to database u should use jdbc code.

    // i suggest u to use Symantec's Visual Cafe (IDE) which is simple

    // to create forms similar to VB.


    best wishes

    thiru


    [email protected]

  4. #4
    Join Date
    Apr 2000
    Location
    AP,India
    Posts
    3

    Re: TextField

    Hi !
    you can create TextField and TextArea

    Frame f = new Frame("MyWindow");
    TextFiled tf = new TextField(" ",30);
    TextArea ta = new TextArea(5,30);
    f.setLayout(new FlowLayout());
    f.add(tf);
    f.add(ta);



    you can use setEditable() for TextFiled,TextArea also,


    Shyam Sunder Reddy L,
    India.

  5. #5
    Guest

    Re: TextField

    hi gouri,
    Since u ar using jdk1.2 plz make me confirm u ar using Swing or awt first.
    if u ar using awt simply create

    Frame f=new Frame("Sample");
    TextField tf=new TextField("");
    TextArea ta=new TextArea("");
    f.add(tf);
    f.add(ta);

    and if u ar using Swing use JFrame,JTextField and JTextArea.

    But u may problems with light weight and heavy weight components
    if there is any problem set the parent ie. JFrame as a heavy weight component for syntax plz refer the api.

    with regards
    bharath reddy s.v

    Email to: [email protected]





  6. #6
    Join Date
    Apr 2000
    Location
    IL,U.S.A
    Posts
    33

    Re: TextField

    Gauri,
    If you want to just display a dialog box, try using the JDialog in SWING.

    Sushma


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured