Topic
  • 7 replies
  • Latest Post - ‏2007-11-09T20:12:04Z by SystemAdmin
SystemAdmin
SystemAdmin
9394 Posts

Pinned topic Re: Display an ampersand in a Label

‏2007-11-05T14:12:58Z |
On 11/02/2007 09:04:24 PM Andrew Cornwallwrote:

>JRancier@penntraffic.com wrote:
>> On 11/02/2007 04:04:01 PM JRancierwrote:
>>
>>> When I attempt to display the ampersand (&) in a Label the character
>>> doesn't display, but underlines the following character. Is there
>>> something special I need to do here? E.g., attempting to display
>> (without
>>> the quotes) "Stop&Shop" , what gets displayed is "StopShop. Any
ideas?
>>
>> That's with the seconds 'S' underlined.
>
>Microsoft underlines the first thing following an ampersand. According
>to this link:
>http://support.microsoft.com/kb/q113490/
>.... you can get around this by using "Stop&&Shop" rather than
>"Stop&Shop" as your menu item. (I haven't tried this, but since MS is
>the one doing the underlining, I'm assuming they'll also correctly
>interpret the && :-)
>

Thanks Andrew, that did the job, is it just a Windows Mobile issue? It
works fine on XP. I hate to have to process every character I display
before assigning it. Not only that, but now I need to keep track of the
OS I'm running on as well... Not to mention the fact that String
manipulation is only partially supported with CDC 1.0/PP 1.0
Updated on 2007-11-09T20:12:04Z at 2007-11-09T20:12:04Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    9394 Posts

    Re: Display an ampersand in a Label

    ‏2007-11-06T00:16:38Z  
    JRancier@penntraffic.com wrote:
    Thanks Andrew, that did the job, is it just a Windows Mobile issue? It
    works fine on XP. I hate to have to process every character I display
    before assigning it. Not only that, but now I need to keep track of the
    OS I'm running on as well... Not to mention the fact that String
    manipulation is only partially supported with CDC 1.0/PP 1.0

    I would have expected this to happen on all Windows platforms - and I'm
    a little surprised that you don't see it on XP as well. Are you using
    the same version of VM / class libraries on both? I know the 5.7 stream
    talks to native widgets in a different way than the 6.1 stream. So a fix
    might simply be to move to the stream that you find more appropriate, if
    you have that option.

    Andrew Jr.

    ======================================================================
    IBM Phoenix Labs (OTI)
    2929 North Central Avenue
    Phoenix, Arizona, USA 85012
  • SystemAdmin
    SystemAdmin
    9394 Posts

    Re: Display an ampersand in a Label

    ‏2007-11-06T14:36:28Z  
    JRancier@penntraffic.com wrote:
    Thanks Andrew, that did the job, is it just a Windows Mobile issue? It
    works fine on XP. I hate to have to process every character I display
    before assigning it. Not only that, but now I need to keep track of the
    OS I'm running on as well... Not to mention the fact that String
    manipulation is only partially supported with CDC 1.0/PP 1.0

    I would have expected this to happen on all Windows platforms - and I'm
    a little surprised that you don't see it on XP as well. Are you using
    the same version of VM / class libraries on both? I know the 5.7 stream
    talks to native widgets in a different way than the 6.1 stream. So a fix
    might simply be to move to the stream that you find more appropriate, if
    you have that option.

    Andrew Jr.

    ======================================================================
    IBM Phoenix Labs (OTI)
    2929 North Central Avenue
    Phoenix, Arizona, USA 85012
    On 11/05/2007 07:16:38 PM Andrew Cornwallwrote:

    JRancier@penntraffic.com wrote:
    Thanks Andrew, that did the job, is it just a Windows Mobile issue? It
    works fine on XP. I hate to have to process every character I display
    before assigning it. Not only that, but now I need to keep track of
    the
    OS I'm running on as well... Not to mention the fact that String
    manipulation is only partially supported with CDC 1.0/PP 1.0

    I would have expected this to happen on all Windows platforms - and I'm
    a little surprised that you don't see it on XP as well. Are you using
    the same version of VM / class libraries on both? I know the 5.7 stream
    talks to native widgets in a different way than the 6.1 stream. So a fix
    might simply be to move to the stream that you find more appropriate, if

    Good point. I'm using the 1.5.0_12 to develop, setting my source/target
    properties to 1.4. And I see that someone updated my PC, because 'which
    java' resulted in c:\windows\system32\java, and that version is1.6.0. The
    version of the CDC PP1.0 J9 VM is 2.3 for the ARM processor. So, to
    verify the application, I downloaded the XP version of the VM, set my
    JAVA_HOME to be c:\Progra~1\IBM\WEME\runtimes\61\win-x86-ppro10 (all in a
    batch file), and then attempted to use j9w.exe, but now I get the
    following exception thrown:
    Exception in thread "main" java.lang.NoClassDefFoundError:
    java.awt.event.Window
    Adapter
    at java.lang.ClassLoader.defineClassImpl(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:224)
    at
    java.security.SecureClassLoader.defineClass(SecureClassLoader.java:10
    9)
    at java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1030)
    at java.net.URLClassLoader$4.run(URLClassLoader.java:550)
    at
    java.security.AccessController.doPrivileged(AccessController.java:213
    )
    at java.net.URLClassLoader.findClass(URLClassLoader.java:548)
    at
    com.ibm.oti.vm.URLSystemClassLoader.findClass(URLSystemClassLoader.ja
    va:27)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:586)
    at
    com.ibm.oti.vm.URLSystemClassLoader.loadClass(URLSystemClassLoader.ja
    va:60)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:543)

    I see it in ppro10-ui.zip, as I figured, but seeing that j9w executed my
    JAVA_HOME must be set OK. Is there something else I'm missing here?
  • SystemAdmin
    SystemAdmin
    9394 Posts

    Re: Display an ampersand in a Label

    ‏2007-11-06T23:38:24Z  
    On 11/05/2007 07:16:38 PM Andrew Cornwallwrote:

    JRancier@penntraffic.com wrote:
    Thanks Andrew, that did the job, is it just a Windows Mobile issue? It
    works fine on XP. I hate to have to process every character I display
    before assigning it. Not only that, but now I need to keep track of
    the
    OS I'm running on as well... Not to mention the fact that String
    manipulation is only partially supported with CDC 1.0/PP 1.0

    I would have expected this to happen on all Windows platforms - and I'm
    a little surprised that you don't see it on XP as well. Are you using
    the same version of VM / class libraries on both? I know the 5.7 stream
    talks to native widgets in a different way than the 6.1 stream. So a fix
    might simply be to move to the stream that you find more appropriate, if

    Good point. I'm using the 1.5.0_12 to develop, setting my source/target
    properties to 1.4. And I see that someone updated my PC, because 'which
    java' resulted in c:\windows\system32\java, and that version is1.6.0. The
    version of the CDC PP1.0 J9 VM is 2.3 for the ARM processor. So, to
    verify the application, I downloaded the XP version of the VM, set my
    JAVA_HOME to be c:\Progra~1\IBM\WEME\runtimes\61\win-x86-ppro10 (all in a
    batch file), and then attempted to use j9w.exe, but now I get the
    following exception thrown:
    Exception in thread "main" java.lang.NoClassDefFoundError:
    java.awt.event.Window
    Adapter
    at java.lang.ClassLoader.defineClassImpl(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:224)
    at
    java.security.SecureClassLoader.defineClass(SecureClassLoader.java:10
    9)
    at java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1030)
    at java.net.URLClassLoader$4.run(URLClassLoader.java:550)
    at
    java.security.AccessController.doPrivileged(AccessController.java:213
    )
    at java.net.URLClassLoader.findClass(URLClassLoader.java:548)
    at
    com.ibm.oti.vm.URLSystemClassLoader.findClass(URLSystemClassLoader.ja
    va:27)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:586)
    at
    com.ibm.oti.vm.URLSystemClassLoader.loadClass(URLSystemClassLoader.ja
    va:60)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:543)

    I see it in ppro10-ui.zip, as I figured, but seeing that j9w executed my
    JAVA_HOME must be set OK. Is there something else I'm missing here?
    JRancier@penntraffic.com wrote:
    Exception in thread "main" java.lang.NoClassDefFoundError:
    java.awt.event.Window
    Adapter
    at java.lang.ClassLoader.defineClassImpl(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:224)
    at
    java.security.SecureClassLoader.defineClass(SecureClassLoader.java:10
    9)
    at java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1030)
    at java.net.URLClassLoader$4.run(URLClassLoader.java:550)
    at
    java.security.AccessController.doPrivileged(AccessController.java:213
    )
    at java.net.URLClassLoader.findClass(URLClassLoader.java:548)
    at
    com.ibm.oti.vm.URLSystemClassLoader.findClass(URLSystemClassLoader.ja
    va:27)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:586)
    at
    com.ibm.oti.vm.URLSystemClassLoader.loadClass(URLSystemClassLoader.ja
    va:60)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:543)

    I see it in ppro10-ui.zip, as I figured, but seeing that j9w executed my
    JAVA_HOME must be set OK. Is there something else I'm missing here?

    J9 will run without JAVA_HOME set (and in fact, that's how we recommend
    it be run). In addition, I suspect you'll need to run with:
    -jcl:ppro10
    to pick up Personal Profile. With no arguments, you're probably running
    as -jcl:foun10, which would explain why you don't see the PPro classes.

    Andrew Jr.

    ======================================================================
    IBM Phoenix Labs (OTI)
    2929 North Central Avenue
    Phoenix, Arizona, USA 85012
  • SystemAdmin
    SystemAdmin
    9394 Posts

    Re: Display an ampersand in a Label

    ‏2007-11-07T15:08:11Z  
    JRancier@penntraffic.com wrote:
    Exception in thread "main" java.lang.NoClassDefFoundError:
    java.awt.event.Window
    Adapter
    at java.lang.ClassLoader.defineClassImpl(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:224)
    at
    java.security.SecureClassLoader.defineClass(SecureClassLoader.java:10
    9)
    at java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1030)
    at java.net.URLClassLoader$4.run(URLClassLoader.java:550)
    at
    java.security.AccessController.doPrivileged(AccessController.java:213
    )
    at java.net.URLClassLoader.findClass(URLClassLoader.java:548)
    at
    com.ibm.oti.vm.URLSystemClassLoader.findClass(URLSystemClassLoader.ja
    va:27)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:586)
    at
    com.ibm.oti.vm.URLSystemClassLoader.loadClass(URLSystemClassLoader.ja
    va:60)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:543)

    I see it in ppro10-ui.zip, as I figured, but seeing that j9w executed my
    JAVA_HOME must be set OK. Is there something else I'm missing here?

    J9 will run without JAVA_HOME set (and in fact, that's how we recommend
    it be run). In addition, I suspect you'll need to run with:
    -jcl:ppro10
    to pick up Personal Profile. With no arguments, you're probably running
    as -jcl:foun10, which would explain why you don't see the PPro classes.

    Andrew Jr.

    ======================================================================
    IBM Phoenix Labs (OTI)
    2929 North Central Avenue
    Phoenix, Arizona, USA 85012
    On 11/06/2007 06:38:24 PM Andrew Cornwallwrote:

    JRancier@penntraffic.com wrote:
    Exception in thread "main" java.lang.NoClassDefFoundError:
    java.awt.event.Window
    Adapter


    J9 will run without JAVA_HOME set (and in fact, that's how we recommend
    it be run). In addition, I suspect you'll need to run with:
    -jcl:ppro10
    to pick up Personal Profile. With no arguments, you're probably running
    as -jcl:foun10, which would explain why you don't see the PPro classes.

    Thanks as always Andrew. That did the trick. I wrote a method to insert
    the extra '&', based on the OS Architecture, in this case either 'x86' or
    'arm'. I'll have to change that seeing that J9 on XP (2.3) needs the
    extra '&' as well, when the Sun VM does not. I hate to have to write my
    code dependent on VM but I guess that's the way it goes...

    Thanks,
    Jeff
  • SystemAdmin
    SystemAdmin
    9394 Posts

    Re: Display an ampersand in a Label

    ‏2007-11-07T15:23:17Z  
    JRancier@penntraffic.com wrote:
    Exception in thread "main" java.lang.NoClassDefFoundError:
    java.awt.event.Window
    Adapter
    at java.lang.ClassLoader.defineClassImpl(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:224)
    at
    java.security.SecureClassLoader.defineClass(SecureClassLoader.java:10
    9)
    at java.net.URLClassLoader.findClassImpl(URLClassLoader.java:1030)
    at java.net.URLClassLoader$4.run(URLClassLoader.java:550)
    at
    java.security.AccessController.doPrivileged(AccessController.java:213
    )
    at java.net.URLClassLoader.findClass(URLClassLoader.java:548)
    at
    com.ibm.oti.vm.URLSystemClassLoader.findClass(URLSystemClassLoader.ja
    va:27)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:586)
    at
    com.ibm.oti.vm.URLSystemClassLoader.loadClass(URLSystemClassLoader.ja
    va:60)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:543)

    I see it in ppro10-ui.zip, as I figured, but seeing that j9w executed my
    JAVA_HOME must be set OK. Is there something else I'm missing here?

    J9 will run without JAVA_HOME set (and in fact, that's how we recommend
    it be run). In addition, I suspect you'll need to run with:
    -jcl:ppro10
    to pick up Personal Profile. With no arguments, you're probably running
    as -jcl:foun10, which would explain why you don't see the PPro classes.

    Andrew Jr.

    ======================================================================
    IBM Phoenix Labs (OTI)
    2929 North Central Avenue
    Phoenix, Arizona, USA 85012
    On 11/06/2007 06:38:24 PM Andrew Cornwallwrote:

    J9 will run without JAVA_HOME set (and in fact, that's how we recommend
    it be run).

    Why is this? And by the way, why would I use IBM's VM on XP, when I can
    get the JRE from Sun? Is this where IBM is looking to venture?
  • SystemAdmin
    SystemAdmin
    9394 Posts

    Re: Display an ampersand in a Label

    ‏2007-11-07T23:01:22Z  
    On 11/06/2007 06:38:24 PM Andrew Cornwallwrote:

    J9 will run without JAVA_HOME set (and in fact, that's how we recommend
    it be run).

    Why is this? And by the way, why would I use IBM's VM on XP, when I can
    get the JRE from Sun? Is this where IBM is looking to venture?
    JRancier@penntraffic.com wrote:
    On 11/06/2007 06:38:24 PM Andrew Cornwallwrote:

    J9 will run without JAVA_HOME set (and in fact, that's how we recommend
    it be run).

    Why is this?

    In the deep past, the Sun VM required users to set up a JAVA_HOME
    environment variable. Nowadays, both J9 and the Sun VM pay attention to
    JAVA_HOME if it is set, but work perfectly well without it. We recommend
    you don't have JAVA_HOME set because you may have multiple VMs
    (including Sun's VM, other J9 VMs, and possibly more).

    The reason isn't really technical: it's a lot easier for our support
    group to say "make sure you don't have JAVA_HOME set" than for them to
    say "make sure JAVA_HOME points to J9 classes when you run a J9 VM, and
    to Sun classes when you run the Sun VM, and if you have any other VM
    then you need to point it to them when you run their VM."

    And by the way, why would I use IBM's VM on XP, when I can
    get the JRE from Sun? Is this where IBM is looking to venture?

    IBM has several variants of J9 on XP already. If you're using products
    which incorporate Lotus Expeditor (such as Lotus Notes V8 or Lotus
    Sametime V7.5.1), you're already using it. It provides a baseline that
    doesn't have to conform to Sun TCKs, which allows IBM (and you) to do
    things such as remove classes you don't want from classes.zip, making
    installs and execution smaller.

    You might also want to use a MIDP 2.0 VM on XP. Sun provides a MIDP VM
    as part of the Wireless Toolkit, but it's obviously meant as a test
    environment for wireless devices. The J9 VM will let your MIDlets run on
    the desktop in a way that looks like any other XP app.

    Often, it's a business decision and not a technical one. If you're
    delivering a Java application to a client on both mobile and desktop
    environments, you might want a common VM supplier to simplify defect
    reporting / fixing. Since they share a common code base, bug fixes for
    J9 class libraries on mobile devices often fix defects on XP as well,
    and vice versa. (I've heard this called "one throat to choke.") Using
    different VM suppliers means you have to track all the defects exposed
    among all the VMs, and make sure all the VM vendors fix things before
    you ship.

    If you're writing pure Java that you want to run everywhere, it's very
    useful to use multiple VMs to make sure you're not making your code
    dependent on implicit assumptions about your particular VM
    implementation. I know of a number of multithreaded Java applications
    that run just fine on native thread VMs, but which die horribly on green
    thread VMs where threads aren't preemptive. If you're writing your app
    in Java so you can use it on multiple platforms, I'd recommend you get
    as many VMs as you can and try your app on all of them - not just J9 and
    the Sun VM, but also Apache Harmony and others!

    Andrew Jr.

    ======================================================================
    IBM Phoenix Labs (OTI)
    2929 North Central Avenue
    Phoenix, Arizona, USA 85012
  • SystemAdmin
    SystemAdmin
    9394 Posts

    Re: Display an ampersand in a Label

    ‏2007-11-09T20:12:04Z  
    JRancier@penntraffic.com wrote:
    On 11/06/2007 06:38:24 PM Andrew Cornwallwrote:

    J9 will run without JAVA_HOME set (and in fact, that's how we recommend
    it be run).

    Why is this?

    In the deep past, the Sun VM required users to set up a JAVA_HOME
    environment variable. Nowadays, both J9 and the Sun VM pay attention to
    JAVA_HOME if it is set, but work perfectly well without it. We recommend
    you don't have JAVA_HOME set because you may have multiple VMs
    (including Sun's VM, other J9 VMs, and possibly more).

    The reason isn't really technical: it's a lot easier for our support
    group to say "make sure you don't have JAVA_HOME set" than for them to
    say "make sure JAVA_HOME points to J9 classes when you run a J9 VM, and
    to Sun classes when you run the Sun VM, and if you have any other VM
    then you need to point it to them when you run their VM."

    And by the way, why would I use IBM's VM on XP, when I can
    get the JRE from Sun? Is this where IBM is looking to venture?

    IBM has several variants of J9 on XP already. If you're using products
    which incorporate Lotus Expeditor (such as Lotus Notes V8 or Lotus
    Sametime V7.5.1), you're already using it. It provides a baseline that
    doesn't have to conform to Sun TCKs, which allows IBM (and you) to do
    things such as remove classes you don't want from classes.zip, making
    installs and execution smaller.

    You might also want to use a MIDP 2.0 VM on XP. Sun provides a MIDP VM
    as part of the Wireless Toolkit, but it's obviously meant as a test
    environment for wireless devices. The J9 VM will let your MIDlets run on
    the desktop in a way that looks like any other XP app.

    Often, it's a business decision and not a technical one. If you're
    delivering a Java application to a client on both mobile and desktop
    environments, you might want a common VM supplier to simplify defect
    reporting / fixing. Since they share a common code base, bug fixes for
    J9 class libraries on mobile devices often fix defects on XP as well,
    and vice versa. (I've heard this called "one throat to choke.") Using
    different VM suppliers means you have to track all the defects exposed
    among all the VMs, and make sure all the VM vendors fix things before
    you ship.

    If you're writing pure Java that you want to run everywhere, it's very
    useful to use multiple VMs to make sure you're not making your code
    dependent on implicit assumptions about your particular VM
    implementation. I know of a number of multithreaded Java applications
    that run just fine on native thread VMs, but which die horribly on green
    thread VMs where threads aren't preemptive. If you're writing your app
    in Java so you can use it on multiple platforms, I'd recommend you get
    as many VMs as you can and try your app on all of them - not just J9 and
    the Sun VM, but also Apache Harmony and others!

    Andrew Jr.

    ======================================================================
    IBM Phoenix Labs (OTI)
    2929 North Central Avenue
    Phoenix, Arizona, USA 85012
    On 11/07/2007 06:01:22 PM Andrew Cornwallwrote:

    JRancier@penntraffic.com wrote:
    On 11/06/2007 06:38:24 PM Andrew Cornwallwrote:

    J9 will run without JAVA_HOME set (and in fact, that's how we
    recommend
    it be run).

    Why is this?

    In the deep past, the Sun VM required users to set up a JAVA_HOME
    environment variable. Nowadays, both J9 and the Sun VM pay attention to
    JAVA_HOME if it is set, but work perfectly well without it. We recommend
    you don't have JAVA_HOME set because you may have multiple VMs
    (including Sun's VM, other J9 VMs, and possibly more).

    The reason isn't really technical: it's a lot easier for our support
    group to say "make sure you don't have JAVA_HOME set" than for them to
    say "make sure JAVA_HOME points to J9 classes when you run a J9 VM, and
    to Sun classes when you run the Sun VM, and if you have any other VM
    then you need to point it to them when you run their VM."

    And by the way, why would I use IBM's VM on XP, when I can
    get the JRE from Sun? Is this where IBM is looking to venture?

    IBM has several variants of J9 on XP already. If you're using products
    which incorporate Lotus Expeditor (such as Lotus Notes V8 or Lotus
    Sametime V7.5.1), you're already using it. It provides a baseline that
    doesn't have to conform to Sun TCKs, which allows IBM (and you) to do
    things such as remove classes you don't want from classes.zip, making
    installs and execution smaller.

    You might also want to use a MIDP 2.0 VM on XP. Sun provides a MIDP VM
    as part of the Wireless Toolkit, but it's obviously meant as a test
    environment for wireless devices. The J9 VM will let your MIDlets run on
    the desktop in a way that looks like any other XP app.

    Often, it's a business decision and not a technical one. If you're
    delivering a Java application to a client on both mobile and desktop
    environments, you might want a common VM supplier to simplify defect
    reporting / fixing. Since they share a common code base, bug fixes for
    J9 class libraries on mobile devices often fix defects on XP as well,
    and vice versa. (I've heard this called "one throat to choke.") Using
    different VM suppliers means you have to track all the defects exposed
    among all the VMs, and make sure all the VM vendors fix things before
    you ship.

    If you're writing pure Java that you want to run everywhere, it's very
    useful to use multiple VMs to make sure you're not making your code
    dependent on implicit assumptions about your particular VM
    implementation. I know of a number of multithreaded Java applications
    that run just fine on native thread VMs, but which die horribly on green
    thread VMs where threads aren't preemptive. If you're writing your app
    in Java so you can use it on multiple platforms, I'd recommend you get
    as many VMs as you can and try your app on all of them - not just J9 and
    the Sun VM, but also Apache Harmony and others!

    Andrew Jr.

    ======================================================================
    IBM Phoenix Labs (OTI)
    2929 North Central Avenue
    Phoenix, Arizona, USA 85012

    Wow! Thanks for the insight. Have a good weekend.
    Jeff