Renate Junold

Greenhorn
+ Follow
since May 14, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Renate Junold

I am trying to populate a JComboBox in a JApplet.
The JApplet downloads from a webserver and takes a little time to retrieve some objects from a database, it is the names of these objects that I wish to place in the combo box menu.
I have tried two things:
1) Create the JComboBox empty, set the model to be DefaultCombBoxModel and when all the objects are retrieved, create a vector of all the object names, and add then to the combo box as follows:
Iterator objectsIt = addEm.iterator( );
while( objectsIt.hasNext( ) ){
String name = (String)objectsIt.next( );
( ( DefaultComboBoxModel )combo.getModel ( ) ).addElement( name );
itemCount = itemCount + 1;
}
However this results in the combobox popup remaining blank.
If I add a button to the display and wait until all the objects are loaded and then press the button, the result of the button using the same vector to populate the JComboBox (using the same above method) results in the items being displayed in the popup menu of the combo box!!???
2) Wait to create the combobox items until after the objects are retrieved and create the combobox with the vector of object names. I don't know if this works via the download because the comboboxes never appear after I add them to a Jpanel contained in the applet.
I am pretty sure it's a JApplet/Applet problem that I am having, if I run the applet as an application it works fine.
Help is appreciated!
21 years ago
Has anyone encountered (& solved!) the following error:
UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JToolTip[,0,0,0
x0,invalid,alignmentX=null,alignmentY=null,border=,flags=8,maximumSize=,minimumS
ize=,preferredSize=,tipText=]
I am trying to display a tooltip on a JButton which is on a JPanel (which is placed on another JPanel in an JApplet.
I can run the JavaSoft ButtonDemo.java in the same directory as my app and the tooltips display fine!
22 years ago