Results 1 to 4 of 4

Thread: JTextArea

  1. #1
    DaoK
    Guest

    JTextArea

    Code:
    //...
        myTextArea1 = new JTextArea();
        myTextArea1.reshape (0,100,500,200);
        c.add (myTextArea1);
        c.add (new JScrollPane(myTextArea1));
    //...
    why that do not work ? I want a scoll bar in the JTextArea

  2. #2
    DaoK
    Guest
    I have searched in my book and in sun.com and I can not see what's wrong !

  3. #3
    Lively Member
    Join Date
    Feb 2001
    Location
    Jutland, Denmark
    Posts
    71
    Hi
    A small part of a code I normaly use to ScrollPane.
    ****
    jScrollPane2.setVerticalScrollBarPolicy
    (javax.swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    jScrollPane2.setBorder(BorderFactory.createTitledBorder("Tekst"));
    jScrollPane2.setBounds(new Rectangle(0, 108, 634, 156));
    jScrollPane2.getViewport().add(jTextArea2, null);
    this.getContentPane().add(jScrollPane2, null);
    jTextArea2.setWrapStyleWord(true);
    jTextArea2.setLineWrap(true);
    jTextArea2.setBorder(BorderFactory.createLineBorder(Color.black, 1));
    ****

  4. #4
    DaoK
    Guest
    I think is the ways I declare the Container beacuse I know one way to be able to reshape but I can not use ScrollBar and an other way that I can not use reshape but I can use srollbar... that weird.

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