Listener Button problem

This is my first attempt at development for the BB storm, and I use JDE 4.7.

I started with a Hello World application, I found and I modified to add a simple button that says RED. When you click on I tried the wallpaper turn RED and change the button to say BLUE, when that is clicked on it turns BLUE changes back to RED button again.

I've implemented this, use a standard listener ButtonField (which I call bhandler in my code). The program type of works, with the odd effect only on the Simulator is that when I click the button, the background color changes but a little menu appears. Anyone else seen this problem of menu? I don't expect to see a menu and I have not coded anything to ask for a menu appear when I click on this button.

Here is my source code. The Manager is in bold. All the answers that I see not why only a menu would be most appreciated... Thank you.

/**
* HelloWorld.java
* Copyright (C) 2001-2003 research In Motion Limited. All rights reserved.
*/
package com.rim.samples.helloworld;

Net.rim.device.api.ui import. *;
Net.rim.device.api.ui.component import. *;
Net.rim.device.api.ui.container import. *;
Net.rim.device.api.system import. *;
Net.rim.device.api.ui.decor import. *;

/*
* BlackBerry applications that provide a user interface
* must extend UiApplication.
*/
SerializableAttribute public class HelloWorld extends UiApplication
{
Public Shared Sub main (String [] args)
{
create a new instance of the application
and launch the application on the event thread
HelloWorld APP = new HelloWorld();
theApp.enterEventDispatcher ();
}
public HelloWorld()
{
a new screen
pushScreen (new HelloWorldScreen());
}
}

create a new screen that covers the screen, which provides
standard behavior by default for BlackBerry applications
final HelloWorldScreen class extends screen
{
public HelloWorldScreen()
{

call the constructor of the screen
Super();

Add a title to the screen
LabelField title = new LabelField ("HelloWorld example", LabelField.ELLIPSIS
| LabelField.USE_ALL_WIDTH);
setTitle (title);

Add the text "Hello World!" to the screen
Add (new RichTextField ("Hello World!"));
                
First define the button handler
                FieldChangeListener bhandler = new FieldChangeListener()
{
' Public Sub fieldChanged (field field, int context)
{
ButtonField buttonField = field (ButtonField);
If (buttonField.getLabel () is 'RED')
{
Bottom newback = BackgroundFactory.createSolidBackground (Color.RED);
getMainManager () .setBackground (newback);
buttonField.setLabel ("BLUE");
}
on the other
{
Bottom newback = BackgroundFactory.createSolidBackground (Color.BLUE);
getMainManager () .setBackground (newback);
buttonField.setLabel ("RED");
}
}
};

Define the button itself use Manager above, this one called RED
ButtonField buttonField = new ButtonField ("RED");     Create a RED button
buttonField.setChangeListener (bhandler);               Implement the handler for button defined above
                 
Add (buttonField);  Adds the button to the screen.

}

Override the onClose() method to display a dialog to the user
with "Goodbye!" when the application is closed
public boolean onClose()
{
Dialog.Alert ("Goodbye!");
System.Exit (0);
Returns true;
}
}

Solved in Java development.

Tags: BlackBerry Developers

Similar Questions

  • "Home" button problem?

    GGuys that I just bought a new phone I 6, but whenever I touch slightly the home button that feels by clicking a little bit... the fingerprint sensor works well fine.is it something I should worry about?

    Hello Simoskav,

    Thanks for this info and choosing the communities Support from Apple. I know how important ensuring your new iPhone work properly is for you! Based on what you said, it seems you have a problem of physics with the home on the iPhone button, but you can try the steps outlined in this article before install you any type of service:

    Get help with buttons and switches on your iPhone, iPad or iPod touch

    See you soon!

  • "Back" button problem

    I have only the back button. The next button is no more. But my problem is that I can't use the back button. It is always gray and cannot select. I have to use the BACKSPACE on the keyboard to get back on the web. Could you help me with this problem please?

    I found the solution. This is an extension that was causing the problem. The extension name is grant WinToFlash. Just removed and restarted Firefox. Now, not only the back button works again, but the next button appears again.

  • Satellite R830 - keyboard button problem:

    Our Toshiba Satellite R830 has a temperament H key. If you press the left side of the key, it works very well. If you press the right side, this isn't. All other keys are fine. This could be the result of debris?

    Is it easy to jump off the key and pop it back on again?

    Well, what you can do is remove the CAP button and check the box under the hood
    You can use a jet of compressed air to remove dust (if available).
    But I think that its some mechanical problem, the point is that the simple buttons cannot be replaced, you can replace the plugs, but not the button so you will need to replace the entire keyboard to get it repaired.

  • LED power button problem FIXED on Satellite P300

    Toshiba
    LED power button fix

    Toshiba
    Satellite P300-h-13

    By Thom
    Wijtenburg

    First of all, I would like to
    say you that I came up with this correction, after a clean reinstall of the
    Vista. (I used the serial number of windows on the bottom of my laptop for)
    install, so it's the same license as the OEM of windows and therefore
    Tout_a_fait legal.) After the clean install and installation of all the
    the drivers listed on the site of toshiba LED power button (also
    known as the mute button) and the CDDVD butten (mediaplayer button)
    stopped working. After browsing around forums toshiba I found
    this case, I removed the support button utility that the mute button has acted as
    a mute button. Also the mediaplayer button worked fine. Reinstalled
    the utility support for the button and they have stopped working. After many
    toshiba calls (I think about 5-6 in one day) they opened a
    support ticket for me, because they (team support callcenter)
    could not find a solution. Following their advice, I did the
    next to try to make it work:

    * Don't have a system restore with the restore DVD.
    * Do you have an another clean install.
    * Install the drivers in various ways (alphabetically reversed by alphabetical order and order of collection DVD).
    * update my BIOS.
    * downloaded a 'new' version of value added package (which was the same thing I already had).
    * installed the VAP with and without technical support button utility, no changes.
    After doing everything
    This, they said that they did not know the cause of my problem (at the beginning
    they thought it was hardware related). They came with a possible
    anwer:

    "It is."
    possible that we removed some features of windows vista
    operating system so that our one utility for device drivers
    work. In addition, we do support the configuration, that we delivered
    When you bought the laptop. »

    Now of course, I have
    understand that. I waited allmost a week, no response. Neither
    by electronic mail, or by phone, so I decided to google more
    on the problem.

    After a certain
    some research on Toshiba forum and Googling I came across
    a thread that sayd I must first install the utility 'control '.
    and the button press. Unfortunately what it did not work.

    Then, all of a sudden
    Windows displays a message saying that I should install the TOSHIBA.
    "ACPI-based value-added general use and logical device driver.
    I clicked on the provided download link, and the VFR package was a newer version
    version of the support page for my laptop which is held. So I downloaded
    This PPV version 1.17 and installed it. After a reboot, the buttons
    still did not work. But at least I got the file HWSetup.exe, where I
    could turn the LED off. Look into the button holder utility, I have
    saw that there where buttons like "Toshiba Assist" which my
    the laptop model is not.

    Navigation
    through the toshiba forum I found a file named ButtonSettings.ini, in
    which I can manually configure special keys. After a google
    search on the name of the file, I found that all the buttons list
    in a registry key. I saw the "Dimmer" file using the button
    folder and clicked on it. Poof... lights went out. Click again,
    Poof... lights turn it back on. So I replaced the wrong button definitions
    with CDDVD and dimmer values. Saved my changes but is not a restart.
    Opens the support button utility and change the path of
    MediaPlayer (who was always there to a previous definition) to
    Dimmer.exe. checked to see if the button CDDVD pointed
    MediaPlayer and restarted. When everything has been started, I pushed on the
    button again and presto... MUTE lights off. Pushed again, poof...
    lights. Pressed the mediaplayer button and started to mediaplyer. I have
    has been very happy when everything worked.
    Now that you
    know the story, here's the fix.

    * Difficulty: *.
    * Download and install the new VAP from here: [http://cdgenp01.csd.toshiba.com/content/support/downloads/util_tvap_26084A.exe]
    * Choose Edit in the installation and make sure that everything is checked
    * do NOT restart after the installation.
    * Download the ini fix and the fixed registry
    * Uncompress its contents into your working folder.
    * Copy the ini into C:\Program Files\TOSHIBA\TBS (where C: is the drive of program files)
    * In this same folder, start the exe called TBSbtnSt.exe
    * do NOT restart, click on 'no' in the dialog box.
    * Double click on the registry key, and then click 'Yes' to add to the registry
    * Then open the button support utility by clicking Start-> Toshiba-> utilities-> Toshiba assist. Help go to optimilization and click support button tohiba
    * If the path or the description is disabled, fix, and then click Save. See also if the CD/DVD mediaplayer points.
    * Restart you computer now.
    * If everything is is well past your special buttons should work.

    * WARNING: *.

    It worked for
    me, with my Toshiba Satellite P300-h-13, edition windows Home premium 32-bit.
    It should work on any model of 6 buttons with the mediaplayer and the mute
    buttons. I am in no way responsible for any damage that may arise
    If the fix does not work correctly. There is absolutely no. GARUENTEE
    It will work for you. If the answer is Yes, he does, and if it's not it
    doesn't work.

    * Author: *.

    I came
    With this fix by myself, without any help from toshiba support. I am
    the original author of this text. This document is for information
    purposes and should not be modified in any way.

    This page is
    also hosted on my Web site for documentation purposes. I have
    contacted toshiba support on my support ticket and has asked to
    Cancel and read this. I have also explained in the world.

    Wow, that's really cool! I think that a lot of users here would appreciate this extraordinary well documented fix.

    Thanks dude. :)

    Welcome them

  • Satellite R850-12 x - space bar button problem

    Hello

    I bought yesterday r850-12 x (Russian version) and you have probably noticed, that if I press the space bar on his left side, he does not respond, resulting in several space missing...

    I googled a little and it seems happens from time to time in different models.

    Question:
    Is this something in common that can be fixed quickly? I need compputer, and the retailer, where I bought it, said that the return (including expertise from Toshiba) takes 5 to 20 days.

    This is stupid, so I need to understand, if this problem can be solved quickly - or not... My toshibas have never failed, so far...

    Well, in the worst cases, your space button may be default and this can be solved by the replacement of keyboard.
    But this means that you must return the device to the AEP from Toshiba which would be able to help you.

    On the other hand, it would be possible that the space button stick somehow
    you could try to remove the stopper carefully and could check if you could clean the plastic brackets.

    I found Nice youtube video how to do this:
    http://www.YouTube.com/watch?v=mKzNWd_WtW0

    But if you put t want to risk injury, contact a Toshiba ASP.

  • Dynadock U eject button problem

    * _Issue_: * when you press the eject button on the Dynadock U, there seems to only be no activity whatsoever in Windows 8 64-bit Machine. I have a total of 3 hard disks connected at any time, and finally end up them manually eject before pulling the plug.

    My installation procedure was to go to the Web of DisplayLink website at [http://www.displaylink.com/support/downloads.php | http://www.displaylink.com/support/downloads.php] and downloaded the latest drivers. Then restarted the system and connected the USB to the computer.

    Can support Toshiba back to me on this or if someone managed to solve this problem, could they bring a solution please?

    Hi fareed_xtreme. Do you have news?
    It seems that Displaylink has provided an update to Win 8
    Check it!

  • Satellite A300 - replacement for the keyboard button problem

    Satellite A300 broken my number key 3.
    Easy to fix but still Toshiba have charged me £43 to replace it with a new full keyboard.
    It is less than 6 months old and still under warranty.

    What an absolute joke, I wouldn't have another toshiba again.

    > What an absolute joke, I wouldn't have another Toshiba again.
    Well, it is your personal opinion but I agree.

    However, if you understand something about laptops so you'd know that the single button can not be replaced.
    Only the CAP can be replaced but not the button on the keyboard, and thus the entire keyboard needs to be replaced!

    In addition, the guarantee only covers hardware problems that are not caused by laptop user I n don't know why the button on your keyboard is broken (maybe you was your fault) but I think that you have contacted the ASP in your country and talked to the technician then why you didn't explain that it wasn't your fault?

    In any case, the case should be clear now

  • Satellite P500 PSPGSE - Start Power button problem

    Hello! Hi, I have a problem with my laptop!

    Power-start button on my usual (pspgse drivers) Toshiba p500 works, but when I use remote control work.
    A month AGO portable is in SERVICE of TOSHIBA in Serbia and they say that this is a problem in the bios and they Flash bios.
    But a mounting later same problem.

    It is not Bios are now what is the problem?

    Thanks in advance!

    Hello

    It might be the problem of equipment in my opinion, you should contact the ASP and should talk to the guys that this problem is not resolved.

  • custom scaling button problem

    Hi, I'm trying to customize some controls, but I have a problem with the construction of a button. I replaced the central image by a more realistic appearance and now I want to change the scale to better understand my button again, but I can't put across the 'ladder' after I want to be able to better run the needle and I can't choose the position of the needle. I am attaching the file so you can view and maybe help me to make this more comfortable button thank you!

    to customize your Ctrl button, click on the 'key' to display the icon.then of "clips" you can do what you want with the image or the button of properties, including the streching the balance to make pivot 360 degs, maximum range, no ticks, ticks, etc... BTW, reorganize tab is practical by placing objects to the front or the rear of several images

  • Windows cross button problem.

    Hello

    I am trying to replace a button to stop a while loop by windows cross button using the structure of the event. Looks like the VI window closes, but it does not stop. I use this Sub vi vi. If the block diagram look like a stange. Please try to run the main vi. Can you help me understand what the problem is? I want the same functionality for both cases.

    Here is a quick sketch. Make sure that the Subvi is set to open the front panel and close thereafter, and then close it before the race.

  • Compaq Presario start button problem

    I have a problem with the Start button on the Tower on my Compaq Presario SR1879UK Tower. When I pressed the button start on the PC Tower didn't, but the light that surrounds the button start flashed constantly. I tried to press the button to turn it off, but nothing happened and the light kept flashing.

    Finally I turned off the power at the wall outlet. When I turned it on the same thing happened. However, when I tried after about an hour after I turned it off at the entrance to wall the PC the as usual. He did this several times to come variously and not. Now it lights up at all, and the Start button light is flashing.

    Can anyone help please?

    Thank you

    This problem has been resolved by repairers poses a new motherboard.

    Thanks for all the help

    pinkcloud

  • To help, very simple event button problem, does not.

    Hi guys,.

    Very strange problem. Only when I "to highlight execution", it works. otherwise, it does not.

    I just click on the 'next page' button and go to the next page on the control of 'tab '.  What I am

    do wrong here?  I'm using LabVIEW 9.0f3, Windows 7.

    Thank you very much!

    Weiyuan

    Why do you use the mouse to the bottom of the event?  I have a feeling that you have essentially a race condition between the user making a MouseDown on the button and the execution of the event.  Because the event fires immediately, it occurs when the user still has the key pressed down and in the context of this tab page.  So does not change the tab and the button will pop up.

    Use a change event of value for the button operation of the button to lock when released and move the terminal of the button inside the case of the button value change event.  Then, you can get rid of the writing, a fake to the local variable and thus eliminate the flat sequence structure.

  • ProBook 640 G1: Audio HW buttons problem after Windows Installer 10

    Hello world.

    Last week, I upgraded from W7 to W10, installed all the drivers from HP and upgrades all the buttons and then the keys fn + hardware configurations worked as expected.

    Today I swapped HDD with SSD and installed a clean W10. Yet once with all HP drivers, including sp71790 Hotkey support and support wireless sp71707 button.

    Now the wireless button keys fn + f9/f10 and fn + f6/f7 works as it should, but rather:

    -the works of Mute speakers button (speakers get mute and screen popup confirmation appears) but still, it stays white and is not orange when muted. It's infortunate because mute State speaker is missing.

    -does not work microphone mute (fn + f8) and signalling led on the button turns on. (The microphone itself works, but she's not get dumb).

    These features worked flawlessly in W10 when upgraded to W7. In the new facility, that they do not.

    Can someone help me?

    Thank you.

    PROBLEM SOLVED

    Audio chipset on my G1 640 is audio IDT high definition.

    Unfortunately, it seems that no updated drivers are available after 2014 - win8.1

    I just took and installed the IDT audio driver in the list of drivers for the G1 640 win8.1.

    Now, all the keyboard shortcuts work properly and a panel of additional audio control with various features and functions has been added.

    Win10 instead by default installs a sound driver of 'High definition' of Microsoft which is probably a simplified version of vanilla with no improvements, but the most important is not well interact with HP quick access keys.

    HP should get aware of this and direct customers towards using the old win8.1 IDT, not the driver Microsoft.

  • hp6830s wireless button problem!

    Help, please. I can't turn on the wireless network and bluetooth on at the same time on my hp6830s, it is one or the other.

    I have installed hp wireless assistant but it does not help. When I press the button disable wlan turn on bluetooth (and reverse).

    I tried to uninstall the drivers bluetooth and wlan, then enable and disable it in the bios, but it does not help.

    I solved the problem with resetting the bios... But I did not change the bios settings before that... I thing this bios HP firmwares have a lot of bugs.

Maybe you are looking for