I am trying to add a vertical scroll of a text field of java programs. I use this code to create my JScrollPane:
console = my textarea.
I also declare JScrollPane vertical;
vertical = new JScrollPane(console); vertical.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); vertical.setVisible(true); this.add(vertical);
EDIT:
Type of program:
I am new to Java but should not work and add vertical scrollbar to textbox
What am I doing wrong?
Thanks for any help.
source share