I want to fix the header of my content so it does not scroll down with the content. Is it possible to do it with a, and if yes, could you please shed some light as to how I can go about implementing it without using a JTable.
Asked
Active
Viewed 2,534 times
2 Answers
3
JScrollPane
has
public void setRowHeader(JViewport rowHeader)
See e.g. http://www.java2s.com/Code/Java/Swing-JFC/Scrollpaneruler.htm

StanislavL
- 56,971
- 9
- 68
- 98
-
2Use `setColumnHeaderView` to get the header above the content and you don't have to make your own view port. – Walter Laan Sep 20 '12 at 12:27
-
@ Walter Laan You are right! Both row and column headers are possible. – StanislavL Sep 20 '12 at 12:32
-
Thanx a lot for the info @ StanislavL, I appreciate it, @ Walter thank you, exactly what I needed, it really worked wonders. Wish I could mark it as useful but I dont have enough reputation points. Once again thank you guys. – Raymond Nakampe Sep 20 '12 at 15:27
2
JTable in the JScrollPane has TableHeader fixed in Rectangle
there are three (standard)ways where isn't
TableHeader
fixed on somePoint
JTable
in theJScrollPane
is layed by som of LayoutManager (notice depends of type ofLayoutManager
orarea
) into resiziableContainer
JTable
in theJScrollPane
could be draggableJTable
has resizableColumnModel

Andrew Thompson
- 168,117
- 40
- 217
- 433

mKorbel
- 109,525
- 20
- 134
- 319