2

I need to save a JScrollPane's content as an image. It's content is too big to fit into the screen, so it has scroll bars.

Is there a way to get all content of this pane, including row and column headers, without scroll bars ?

I tried this :

scrollPane().getViewport()

but it displays only the content, without row/column headers.

Here is the example what the scroll pane shows Example

StKiller
  • 7,631
  • 10
  • 43
  • 56

1 Answers1

1

It is a table, so it installs additional components in the row header and column header, you might need to get them and paint them separately.

They are viewports as well, so you can reuse your code, and apply some translation to compose them

JScrollPane.getColumnHeader()
JScrollPane.getRowHeader()

MockerTim
  • 2,475
  • 1
  • 25
  • 31
fortran
  • 74,053
  • 25
  • 135
  • 175