0

I developed my Java application in Swing. The application has been running fine until the time I added Sea Glass Look and Feel. When I disable Sea Glass L&F may the application will run fine. Sometimes it runs fine with Sea Glass L&F and sometimes it throws an exception. I understand that the Sea Glass L&F is causing this exception. I could post the SSCCE/MCVE but the application has many classes; However, the exception below shows what went wrong with the application. The situation is similar to this one here.

Qns How do we solve this Class cast exception?

Below is the exception:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: com.seaglasslookandfeel.component.SeaGlassTitlePane cannot be cast to javax.swing.JScrollBar
at com.seaglasslookandfeel.state.ScrollBarButtonIsIncreaseButtonState.isInState(ScrollBarButtonIsIncreaseButtonState.java:44)
at com.seaglasslookandfeel.state.State.isInState(State.java:160)
at com.seaglasslookandfeel.SeaGlassStyle.getExtendedState(SeaGlassStyle.java:1288)
at com.seaglasslookandfeel.SeaGlassStyle.get(SeaGlassStyle.java:997)
at javax.swing.plaf.synth.SynthStyle.getIcon(Unknown Source)
at javax.swing.plaf.synth.SynthMenuUI.paint(Unknown Source)
at javax.swing.plaf.synth.SynthMenuUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JLayeredPane.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager$4.run(Unknown Source)
pagid
  • 13,559
  • 11
  • 78
  • 104
CN1002
  • 1,115
  • 3
  • 20
  • 40
  • 1
    *"I could post the SSCCE/MCVE but the application has many classes;"* So prepare an MCVE that does ***not*** have 'many classes', but just the necessary code to produce the error. – Andrew Thompson Mar 07 '15 at 07:51
  • @AndrewThompson Okay let me do that. – CN1002 Mar 07 '15 at 08:00
  • talking about I can't run correctly on todays Java versions – mKorbel Mar 07 '15 at 08:21
  • there must be the same solution as for TItileBorders – mKorbel Mar 07 '15 at 08:22
  • @AndrewThompson I prepared the MCVE but this one is not throwing any exceptions! I think the problem is related to the "third part package" -Sea Glass -because sometimes the error is shown and sometimes not. – CN1002 Mar 07 '15 at 08:51
  • Well, looks like you're better off a) using a different PLAF or b) taking it back to the makers of the sea glass PLAF or c) both. Really nothing we can do to help here. – Andrew Thompson Mar 07 '15 at 09:03
  • 1
    @AndrewThompson if you look at [this](https://code.google.com/p/seaglass/issues/detail?id=110) and also [this](https://code.google.com/p/seaglass/issues/detail?id=41) you will realize the cause. – CN1002 Mar 07 '15 at 09:07
  • Well, supposedly as of April 9th 2010 it is fixed. But I've got to say, if the problem is with one LAF only, and it is a 3rd party LAF, I'm having trouble maintaining any interest... If you want to persist using a LAF that claims a problem is fixed when it isn't, I guess that's your choice. – Andrew Thompson Mar 07 '15 at 09:53

0 Answers0