View Review Details


Book:   Swing Hacks
Subject:   have bug in hacker#11-12
Date:   2008-07-09 01:07:43
From:   Steven
the examples in hack #11-12 can't run
because it get exception in UIManager.put(..)




<exception here>
UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JPopupMenu[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,desiredLocationX=0,desiredLocationY=0,label=,lightWeightPopupEnabled=true,margin=,paintBorder=true]
java.lang.Error
at javax.swing.UIDefaults.getUIError(Unknown Source)
at javax.swing.MultiUIDefaults.getUIError(Unknown Source)
at javax.swing.UIDefaults.getUI(Unknown Source)
at javax.swing.UIManager.getUI(Unknown Source)
at javax.swing.JPopupMenu.updateUI(Unknown Source)
at javax.swing.JPopupMenu.<init>(Unknown Source)
at javax.swing.JPopupMenu.<init>(Unknown Source)
at javax.swing.JMenu.ensurePopupMenuCreated(Unknown Source)
at javax.swing.JMenu.add(Unknown Source)
at swing.jcomponent.MenuTest.main(MenuTest.java:24)
UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JPopupMenu[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,desiredLocationX=0,desiredLocationY=0,label=,lightWeightPopupEnabled=true,margin=,paintBorder=true]
java.lang.Error
at javax.swing.UIDefaults.getUIError(Unknown Source)
at javax.swing.MultiUIDefaults.getUIError(Unknown Source)
at javax.swing.UIDefaults.getUI(Unknown Source)
at javax.swing.UIManager.getUI(Unknown Source)
at javax.swing.JPopupMenu.updateUI(Unknown Source)
at javax.swing.JPopupMenu.<init>(Unknown Source)
at javax.swing.JPopupMenu.<init>(Unknown Source)
at javax.swing.JMenu.ensurePopupMenuCreated(Unknown Source)
at javax.swing.JMenu.add(Unknown Source)
at swing.jcomponent.MenuTest.main(MenuTest.java:30)