-
Bug
-
Resolution: Fixed
-
P2
-
1.3.0
-
beta
-
x86, sparc
-
solaris_2.6, windows_nt
-
Verified
Build : 'I' (last build work: 'A', unable to test B, C failed in 'D')
according to our 2D eng build bringovers, it worked on 19-May but
failed on 20-May.
OS : all platforms.
app : Java2Demo.jar (sub demo: Intro)
execution: java -cp Java2Demo.jar Intro
{right click on border to get to the JTable}
This particular panel calls up a lightweight JTable with Column Headers, but headers fails to appear.
import javax.swing.JTable;
import javax.swing.JScrollPane;
import javax.swing.JPanel;
import javax.swing.JFrame;
import java.awt.*;
import java.awt.event.*;
public class ColHeaderBug extends JFrame {
public ColHeaderBug() {super("ColHeaderBug");
Object[][] data = {
{"r1c1", "col2", "col3"},
{"r2c1", "col2", "col3"},
{"r3c1", "col2", "col3"},
{"r4c1", "col2", "col3"},
};
String[] columnNames = {"",
"Column 2",
"Column 3"};
final JTable table = new JTable(data, columnNames);
table.setPreferredScrollableViewportSize(new Dimension(200, 100));
JScrollPane scrollPane = new JScrollPane(table);
getContentPane().add(scrollPane, BorderLayout.CENTER);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}
public static void main(String[] args) {
ColHeaderBug frame = new ColHeaderBug();
frame.pack();
frame.setVisible(true);
}
}
according to our 2D eng build bringovers, it worked on 19-May but
failed on 20-May.
OS : all platforms.
app : Java2Demo.jar (sub demo: Intro)
execution: java -cp Java2Demo.jar Intro
{right click on border to get to the JTable}
This particular panel calls up a lightweight JTable with Column Headers, but headers fails to appear.
import javax.swing.JTable;
import javax.swing.JScrollPane;
import javax.swing.JPanel;
import javax.swing.JFrame;
import java.awt.*;
import java.awt.event.*;
public class ColHeaderBug extends JFrame {
public ColHeaderBug() {super("ColHeaderBug");
Object[][] data = {
{"r1c1", "col2", "col3"},
{"r2c1", "col2", "col3"},
{"r3c1", "col2", "col3"},
{"r4c1", "col2", "col3"},
};
String[] columnNames = {"",
"Column 2",
"Column 3"};
final JTable table = new JTable(data, columnNames);
table.setPreferredScrollableViewportSize(new Dimension(200, 100));
JScrollPane scrollPane = new JScrollPane(table);
getContentPane().add(scrollPane, BorderLayout.CENTER);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}
public static void main(String[] args) {
ColHeaderBug frame = new ColHeaderBug();
frame.pack();
frame.setVisible(true);
}
}
- relates to
-
JDK-4492484 Win L&F: JTable fails to draw header containing empty string under Windows Look-
- Resolved