*
The moose likes Swing / AWT / SWT and the fly likes Please help:UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JMenuBar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Please help:UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JMenuBar" Watch "Please help:UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JMenuBar" New topic
Author

Please help:UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JMenuBar

kwwong wong
Ranch Hand

Joined: Feb 15, 2002
Posts: 56
I using JBuilder to pack the application in executable jar file. When run the program, it through the following errors on JMenuBar, JMenu, JPasswordField and JButton:
UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JMenuBar[,0,0,0x0,invalid,alignmentX=null,alignmentY=null,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,margin=,paintBorder=true]
java.lang.Error
at javax.swing.UIDefaults.getUIError(Unknown Source)
at javax.swing.UIDefaults.getUI(Unknown Source)
at javax.swing.UIManager.getUI(Unknown Source)
at javax.swing.JMenuBar.updateUI(Unknown Source)
at javax.swing.JMenuBar.<init>(Unknown Source)
at team6.inv.gui.MainFrame.<init>(MainFrame.java:19)
at team6.inv.gui.MainApplication.<init>(MainApplication.java:24)
at team6.inv.gui.MainApplication.main(MainApplication.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JMenu[,0,0,0x0,invalid,alignmentX=null,alignmentY=null,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=null,paintBorder=false,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=]
java.lang.Error
at javax.swing.UIDefaults.getUIError(Unknown Source)
at javax.swing.UIDefaults.getUI(Unknown Source)
What is the problem ?
kyle amburn
Ranch Hand

Joined: Jul 29, 2001
Posts: 64
Did you try to set a different look and feel? The error is stating that there is no UI delegate for the component. This means that some loook and feel either fails to, or is pointing to a non existenet ComponentUI.
Kyle
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Please help:UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JMenuBar
 
Similar Threads
Debian + J2RE1.41: Can't run JAR-File
Look And Feel Problem
please help with LOOK AND FEEL
why is this happening REALLY URGENT
Debian+J2RE1.41 : Unable to run JAR-file