Truman Purnell
Truman Purnell

Reputation: 305

Using JScrollpane with the drawline() method

If the drawline() method does not add components, how can I display lines hidden off the side of the page with a JScrollpane?

Upvotes: 0

Views: 44

Answers (1)

MadProgrammer
MadProgrammer

Reputation: 347204

JScrollPane use the component's getPreferredSize result to make determinations about how large the component is and if it needs to show the scroll bars or not.

Start by overriding the component's getPreferredSize method and return an appropriate size which meets the component's current needs

I would recommend having a look at How to use scroll panes for more details

Upvotes: 1

Related Questions