[macosx] JTableHeader painting error with Java 8 on Mac
Alexander Scherbatiy
alexandr.scherbatiy at oracle.com
Thu Jun 13 05:26:14 PDT 2013
On 6/13/2013 3:54 PM, Alexander Scherbatiy wrote:
> On 6/11/2013 4:47 PM, Van Den Borre, Koen wrote:
>> Hi,
>>
>> I noticed that on Java 8 on Mac, the JTableHeader looks clipped (the
>> bottom line is not visible).
>> This was not an issue in Java 6.
>
> It seems that there should be newHeight + 1 for the border painting:
> http://hg.openjdk.java.net/jdk8/awt/jdk/file/a7d943998bd3/src/macosx/classes/com/apple/laf/AquaTableHeaderBorder.java
>
>
> 102 final int newX = x;
> 103 final int newY = y;
> 104 final int newWidth = width;
> 105 final int newHeight = height;
> 106
> 107 painter.paint(g, c, newX - 1, newY - 1, newWidth +
> 1, newHeight);
>
> This is a good chance for the JDK 8 patch contribution.
I have created the issue 8016524 [macosx] Bottom line is not visible
for JTableHeader
http://bugs.sun.com/view_bug.do?bug_id=8016524
It should be public available soon.
Thanks,
Alexandr.
>
> Thanks,
> Alexandr.
>
>>
>> Here is a simple test case:
>>
>> import javax.swing.JFrame;
>> import javax.swing.JScrollPane;
>> import javax.swing.JTable;
>> import javax.swing.SwingUtilities;
>>
>> public class JTableHeaderTest
>> {
>> public void run()
>> {
>> JTable table = new JTable(2, 5);
>>
>> JScrollPane scrollableTable = new JScrollPane(table);
>>
>> JFrame frame = new JFrame();
>> frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
>> frame.getContentPane().add(scrollableTable);
>> frame.setSize(300, 300);
>> frame.setLocationRelativeTo(null);
>> frame.setVisible(true);
>> }
>>
>> public static void main(String[] arguments)
>> {
>> SwingUtilities.invokeLater(new Runnable()
>> {
>> @Override
>> public void run()
>> {
>> JTableHeaderTest test = new JTableHeaderTest();
>> test.run();
>> }
>> });
>> }
>> }
>
More information about the macosx-port-dev
mailing list