SWT table header height with cross-platform image

Java SWT table

I have added an image along with text for each column in my table.

The table displays fine on Windows and Linux, however on Mac Java does not use an image to resize the table header. Is there a job or a trick?

...
// Create the table columns.
TableViewer oTableViewer = new TableViewer(oSash, SWT.BORDER | SWT.MULTI);
Table oTable = oTableViewer.getTable();
...
oTable.setHeaderVisible(true);
TableColumns[] oColumns = new TableColumn[3];
for (int iColumn = 0; iColumn < oColumns.length; iColumn++)
    oColumns[iColumn] = new TableColumn(oTable, SWT.NONE);

...
Image imgCol1 = new Image(display, oStream);
Image imgCol2 = new Image(display, oStream);
Image imgCol3 = new Image(display, oStream);

// Set the column widths and names.
oColumns[0].setText("My 1st Column");
oColumns[0].setWidth(100);
oColumns[0].setImage(imgCol1);
oColumns[1].setText("My 2nd Column");
oColumns[1].setWidth(100);
oColumns[1].setImage(imgCol2);
oColumns[2].setText("My 3rd Column");
oColumns[2].setWidth(100);
oColumns[2].setImage(imgCol3);

      

I am using Eclipse Luna.

The Mac in question has the latest JDK, v8. I downloaded the JDK on Mac last week, so last week was the latest and greatest 64-bit JDK.

Oh, I took a look at this question on Stackoverflow, but it didn't sadly talk about images.

+3
java image swt


source to share


No one has answered this question yet

See similar questions:

0
SWT TableViewer table header height

or similar:

573
How do I get the size of an image (height and width) using JavaScript?
29
Building a cross-platform Java SWT application
five
Implementing cross platform SWT detection
1
How do I set the height of a SWT table header?
1
Fixed Height SWT Table
1
How to get the SWT Window Builder in 64 bit Eclipse
0
reducing the size of the cross-platform SWT
0
SWT TableViewer table header height
0
org.eclipse.core.runtime.AssertionFailedException: Assertion failed:
0
SWT Table and Tableviewer



All Articles
Loading...
X
Show
Funny
Dev
Pics