Thursday, May 17th 2012, 5:22pm UTC+2

You are not logged in.

  • Login
  • Register

1

Thursday, June 25th 2009, 1:10pm

Multi-line jbgrid header

Is it possible to create a jbgrid with multi-line header similar to attached?

James
jcfuller has attached the following image:
  • grid.JPG

OlimilO

Intermediate

Posts: 277

Location: Germany

Occupation: software engineer

2

Thursday, June 25th 2009, 3:51pm

Hi James,

yes this could be possible, maybe one solution could be to make your own TableCellRenderer.

You have to do this by making a new class, maybe you could use a JLable as SuperClass, and you must Implement the Interface TableCellRenderer. You first have to search for this class via the menu

Project->References(Classpath)

and then add it by checking the checkmark in front of TableCellRenderer



in your new class type:

Jabaco Source

1
Implements TableCellRenderer


Jabaco then automatically will add the following function to your class:

Jabaco Source

1
2
3
Public Function getTableCellRendererComponent(arg2 As JTable, arg3 As Object, arg4 As Boolean, arg5 As Boolean, arg6 As Integer, arg7 As Integer) As Component

End Function


and you have to add this line to this function:

Jabaco Source

1
getTableCellRendererComponent = Me




regards

OlimilO

Dani

Trainee

Posts: 68

Location: GERMANY

3

Friday, December 9th 2011, 5:54pm

Jabaco Source

1
2
JBGrid1.HeaderHeight = 60  
JBGrid1.Header(1) = "<html>multiline header<br>JBGrid</html>"

:D

Rate this thread
WoltLab Burning Board