-
Bug
-
Resolution: Fixed
-
P3
-
9, 10, 11, 12, 13, 14
-
b13
-
x86_64
-
windows_10
A DESCRIPTION OF THE PROBLEM :
There was code added to "BasicTableUI.paint(g, c)" between Java 8 and Java 12, which decrements the max row to paint. Unfortunately, when a JTable is nested within panels, it fails to paint the last visible row because of that new code.
When clicking on the last visible row, eventually that one gets repainted.
REGRESSION : Last worked in version 8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Launch attached test case.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The table shows 3 rows.
ACTUAL -
The table shows 2 rows and a white row. Clicking on that white row forces it to paint.
---------- BEGIN SOURCE ----------
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container contentPane = frame.getContentPane();
JPanel centerPane = new JPanel(new BorderLayout());
centerPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel tablePaneContainer = new JPanel(new BorderLayout());
JPanel tablePane = new JPanel(new BorderLayout());
JTable table = new JTable(new Object[][] {{"row_1_col_1", "row_1_col_2", "row_1_col_3"}, {"row_2_col_1", "row_2_col_2", "row_2_col_3"}, {"row_3_col_1", "row_3_col_2", "row_3_col_3"}, {"row_4_col_1", "row_4_col_2", "row_4_col_3"}}, new String[] {"Col1", "Col2", "Col3"});
table.setPreferredSize(new Dimension(0, table.getRowHeight() * 3));
tablePane.add(table.getTableHeader(), BorderLayout.NORTH);
tablePane.add(table, BorderLayout.CENTER);
tablePaneContainer.add(tablePane, BorderLayout.CENTER);
centerPane.add(tablePaneContainer, BorderLayout.NORTH);
contentPane.add(centerPane, BorderLayout.CENTER);
frame.setSize(800, 600);
frame.setVisible(true);
}
---------- END SOURCE ----------
FREQUENCY : always
There was code added to "BasicTableUI.paint(g, c)" between Java 8 and Java 12, which decrements the max row to paint. Unfortunately, when a JTable is nested within panels, it fails to paint the last visible row because of that new code.
When clicking on the last visible row, eventually that one gets repainted.
REGRESSION : Last worked in version 8
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Launch attached test case.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The table shows 3 rows.
ACTUAL -
The table shows 2 rows and a white row. Clicking on that white row forces it to paint.
---------- BEGIN SOURCE ----------
public static void main(String[] args) throws Exception {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container contentPane = frame.getContentPane();
JPanel centerPane = new JPanel(new BorderLayout());
centerPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel tablePaneContainer = new JPanel(new BorderLayout());
JPanel tablePane = new JPanel(new BorderLayout());
JTable table = new JTable(new Object[][] {{"row_1_col_1", "row_1_col_2", "row_1_col_3"}, {"row_2_col_1", "row_2_col_2", "row_2_col_3"}, {"row_3_col_1", "row_3_col_2", "row_3_col_3"}, {"row_4_col_1", "row_4_col_2", "row_4_col_3"}}, new String[] {"Col1", "Col2", "Col3"});
table.setPreferredSize(new Dimension(0, table.getRowHeight() * 3));
tablePane.add(table.getTableHeader(), BorderLayout.NORTH);
tablePane.add(table, BorderLayout.CENTER);
tablePaneContainer.add(tablePane, BorderLayout.CENTER);
centerPane.add(tablePaneContainer, BorderLayout.NORTH);
contentPane.add(centerPane, BorderLayout.CENTER);
frame.setSize(800, 600);
frame.setVisible(true);
}
---------- END SOURCE ----------
FREQUENCY : always