You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
What steps will reproduce the problem?
1. Create a MidLet that adds a Gauge to an Alert and shows it (see below)
2. Test it in Oracle's emulator or real device to make sure it works
3. Test it in MicroEmulator
What is the expected output? What do you see instead?
It should work. Instead it creates this exception:
java.lang.IllegalArgumentException: This gauge cannot be added to an Alert
at javax.microedition.lcdui.Alert.setIndicator(Alert.java:184)
at microemu.GaugeAlert.startApp(GaugeAlert.java:17)
at javax.microedition.midlet.MIDlet$MIDletAccessor.startApp(MIDlet.java:49)
at org.microemu.app.Common.startMidlet(Common.java:428)
When attaching to it with a debugger, it shows that prefHeight and prefWidth
are defined twice, once private in Item and once (shadowed) package private in
Gauge. The variables of Gauge are both 0, and the code checks them for being -1
(see
http://code.google.com/p/microemu/source/browse/branches/microemulator_2_0_x/mic
roemu-midp/src/main/java/javax/microedition/lcdui/Alert.java#176). Setting them
-1 in the debugger makes the alert visible. I could not find any code that
tries to set these shadowed variables, so I assume it was a mistake to have
these variables there at all.
What version of the product are you using? On what operating system?
2.0.4 on Windows XP
Please provide any additional information below.
package microemu;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class GaugeAlert extends MIDlet {
protected void destroyApp(boolean unconditional) throws MIDletStateChangeException {
}
protected void pauseApp() {
}
protected void startApp() throws MIDletStateChangeException {
Alert a = new Alert("Hello Gauge");
a.setTimeout(Alert.FOREVER);
a.setIndicator(new Gauge(null, false, 5, 2));
Display.getDisplay(this).setCurrent(a);
}
}
Original issue reported on code.google.com by schie...@gmail.com on 21 Dec 2011 at 8:03
The text was updated successfully, but these errors were encountered:
Are there any (sufficiently new) snapshot binaries available or does that mean
I have to get the source from SVN and (try to) build it myself? If the latter,
it can take a while until I find time for doing that.
Original comment by schie...@gmail.com on 26 Jan 2012 at 6:03
Original issue reported on code.google.com by
schie...@gmail.com
on 21 Dec 2011 at 8:03The text was updated successfully, but these errors were encountered: