Reputation: 31
I need to add to a JPanel two JTextArea each one with an own JScrollPane. I don't know how to do it because I don't want the scrollbars to be attached to the JPanel but to each JTextArea. How could I solve this problem? Thank you.
Upvotes: 2
Views: 1386
Reputation: 59650
Add both textarea to different scrollpanes and then add that scrollpanes to jpanel. That is something like this:
panel.add(new JScrollPane(firstTextArea));
panel.add(new JScrollPane(secondTextArea));
Upvotes: 5