|
-
Feb 1st, 2002, 07:05 PM
#1
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
-
Feb 1st, 2002, 08:08 PM
#2
I have searched in my book and in sun.com and I can not see what's wrong !
-
Feb 2nd, 2002, 05:00 AM
#3
Lively Member
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));
****
-
Feb 3rd, 2002, 12:58 PM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|