cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
321tseug
Level 3

java.lang.Error Exception on file browser?

I added a file browser component to a dialog through 'User Interface->Dialogs', and added the dialog in 'Behavior and Logic->Sequences'.when the installation processed, I clicked the 'browse' button on the dialog,nothing happened, and i just found a exception in command line as below:

UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JComboBox[,0,0,0x0,invalid,alignmen
tX=null,alignmentY=null,border=,flags=8,maximumSize=,minimumSize=,preferredSize=,isEditable=false,li
ghtWeightPopupEnabled=true,maximumRowCount=8,selectedItemReminder=]
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.JComboBox.updateUI(Unknown Source)
at javax.swing.JComboBox.init(Unknown Source)
at javax.swing.JComboBox.(Unknown Source)
at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installComponents(Unknown Source)
at javax.swing.plaf.basic.BasicFileChooserUI.installUI(Unknown Source)
at com.sun.java.swing.plaf.windows.WindowsFileChooserUI.installUI(Unknown Source)
at javax.swing.JComponent.setUI(Unknown Source)
at javax.swing.JFileChooser.updateUI(Unknown Source)
at javax.swing.JFileChooser.setup(Unknown Source)
at javax.swing.JFileChooser.(Unknown Source)
at javax.swing.JFileChooser.(Unknown Source)
at com.installshield.ui.controls.swing.SwingBrowseControl.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

java.lang.NullPointerException
at javax.swing.JComboBox.setPopupVisible(Unknown Source)
at javax.swing.JComboBox.hidePopup(Unknown Source)
at javax.swing.JComboBox$1.ancestorAdded(Unknown Source)
at javax.swing.AncestorNotifier.fireAncestorAdded(Unknown Source)
at javax.swing.AncestorNotifier.propertyChange(Unknown Source)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)
at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(Unknown Source)
at javax.swing.JComponent.firePropertyChange(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at javax.swing.JRootPane.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at java.awt.Window.addNotify(Unknown Source)
at java.awt.Dialog.addNotify(Unknown Source)
at java.awt.Window.pack(Unknown Source)
at javax.swing.JFileChooser.createDialog(Unknown Source)
at javax.swing.JFileChooser.showDialog(Unknown Source)
at javax.swing.JFileChooser.showOpenDialog(Unknown Source)
at com.installshield.ui.controls.swing.SwingBrowseControl.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

any ideas about this? and how could i solve this problem?
Labels (1)
0 Kudos
(1) Reply
321tseug
Level 3

I just don't use the default file brwoser component.
I put a textfield and button to let the user select file.

add a listener on browse button:

public void buttonClickedBrowseImportBtn(com.installshield.event.ui.ISControlContext arg0)
{
JFileChooser chooser = new JFileChooser();
ExampleFileFilter filter = new ExampleFileFilter();
filter.addExtension("dat");
filter.setDescription("Data Files");
chooser.setFileFilter(filter);
int returnVal = chooser.showOpenDialog(null);
if(returnVal == JFileChooser.APPROVE_OPTION) {
try {
ISTextField oImportFileFeild = arg0.getISContainer().getTextField( "importFileField" );
oImportFileFeild.setText(chooser.getSelectedFile().getAbsolutePath());
}catch ( Exception e ) {
e.printStackTrace();
}
}
}
0 Kudos