christstc / seaglass

Automatically exported from code.google.com/p/seaglass
0 stars 0 forks source link

ClassCastException in file SeaGlassTableUI.java on line 973 #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Error log:
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException:
javax.swing.JPanel cannot be cast to javax.swing.JViewport
    at
com.seaglasslookandfeel.ui.SeaGlassTableUI$1.paintBorder(SeaGlassTableUI.java:97
3)

There is an exception thrown at the point mentioned in the title, while
trying to paint a new JTabbedPane contents, containing JTable and JPanels,
and makes it impossible to view the table. This is performed due to
changing a tabbed pane. However, minimizing and maximizing the window
causes the tabbed pane to show its new contents properly, without any problems.

A simple change of line 973 to:

Container viewport = table.getParent();

and line 975 to:

if ((viewport instanceof JViewport) && table.getWidth() <
viewport.getWidth()) {

makes it working properly, with the same meaning of code, I hope.

Original issue reported on code.google.com by saephir on 9 Apr 2010 at 1:14

GoogleCodeExporter commented 9 years ago
I believe you're right. I'm making that change now.

Thanks!

Original comment by kahuxtable on 9 Apr 2010 at 4:26