Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7607379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:38:52+00:00 2026-05-31T00:38:52+00:00

attempting a first Blackberry App. It will display diary data (eventually). I’m just trying

  • 0

attempting a first Blackberry App.
It will display diary data (eventually).
I’m just trying to get things working bit by bit.
I can’t get the buttons to work in the simulator ie I click them and nothing happens.
Any help appreciated.
Code is below (hopefully ok formatted – first post so apologies if not).

import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.component.ButtonField;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.component.SeparatorField;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;

/**
 * A class extending the MainScreen class.
 */
public class MyScreen extends MainScreen implements FieldChangeListener
{
/**
 * Creates a new MyScreen object
 */
ButtonField lastWeek;
ButtonField todayWeek;
ButtonField nextWeek;
LabelField Monday;
LabelField MondayData;
LabelField Tuesday;
LabelField TuesdayData;
LabelField Wednesday;
LabelField WednesdayData;
LabelField Thursday;
LabelField ThursdayData;
LabelField Friday;
LabelField FridayData;
LabelField Satday;
LabelField SaturdayData;
LabelField Sunday;
LabelField SundayData;
public MyScreen(){

    LabelField banner = new LabelField("Diary",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);   
    LabelField title = new LabelField("Week starting...",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    LabelField Monday = new LabelField("Monday",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);     
    LabelField MondayData = new LabelField("MondayData",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);    
    LabelField Tuesday = new LabelField("Tuesday",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH); 
    LabelField TuesdayData = new LabelField("TuesdayData",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    LabelField Wednesday = new LabelField("Wednesday",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    LabelField WednesdayData = new LabelField("WednesdayData",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    LabelField Thursday = new LabelField("Thursday",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    LabelField ThursdayData = new LabelField("ThursdayData",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    LabelField Friday = new LabelField("Friday",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    LabelField FridayData = new LabelField("FridayData",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    LabelField Saturday = new LabelField("Saturday",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    LabelField SaturdayData = new LabelField("SaturdayData",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    LabelField Sunday = new LabelField("Sunday",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    LabelField SundayData = new LabelField("Sundaydata",
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);

    HorizontalFieldManager hfm = new HorizontalFieldManager(Field.FIELD_HCENTER);

    ButtonField lastWeek = new ButtonField("<<", ButtonField.CONSUME_CLICK);
    lastWeek.setChangeListener(this);
    ButtonField todayWeek = new ButtonField("Today", ButtonField.CONSUME_CLICK);
    todayWeek.setChangeListener(this);
    ButtonField nextWeek = new ButtonField(">>", ButtonField.CONSUME_CLICK);
    nextWeek.setChangeListener(this);

    hfm.add(lastWeek);hfm.add(todayWeek);hfm.add(nextWeek);
    hfm.setPadding(10, 0, 10, 0);
    VerticalFieldManager vfm = new VerticalFieldManager(Field.FIELD_VCENTER);
    vfm.add(Monday);
    vfm.add(MondayData);
    vfm.add(Tuesday);
    vfm.add(TuesdayData);
    vfm.add(Wednesday);
    vfm.add(WednesdayData);
    vfm.add(Thursday);
    vfm.add(ThursdayData);
    vfm.add(Friday);
    vfm.add(FridayData);
    vfm.add(Saturday);
    vfm.add(SaturdayData);
    vfm.add(Sunday);
    vfm.add(SundayData);






    add(vfm);
    add(new SeparatorField());
    setTitle(title);
    setBanner(banner);

    setStatus(hfm);

  }


public void fieldChanged(Field field, int context) {

    if (field == lastWeek) {
        lastTextFields();
    }
    else if (field == todayWeek) {
        todayTextFields();
    }
    else if (field == nextWeek) {
        nextTextFields();
    }
}
private void lastTextFields() {
    Monday.setText("Monday-old");
    MondayData.setText("MondayData-old");
}
public void todayTextFields() {
    //Monday.setText("Monday");
//  MondayData.setText("MondayData");
    Dialog.inform("Today pressed");
}
private void nextTextFields() {
    Monday.setText("Monday-new");
    MondayData.setText("MondayData-new");
}
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:38:53+00:00Added an answer on May 31, 2026 at 12:38 am

    Since you are running your application on 8520 device simulator that doesn’t have touch screen, clicking on the buttons will get you nowhere. There are several options available:

    Navigate to desired button by using one of the following methods:

    1. Use the keyboard arrow keys to navigate. Press Enter to “click” on it.
    2. Use your mouse’s scroll wheel to navigate and then left click to “click”.
    3. Press F12 to turn “trackball mode” on and use your mouse navigate. Then either press Enter or right click when the desired button is selected.

    Also check this Use the trackball and other Simulating BlackBerry device interaction manuals.

    Alternatively, you can compile your application with JRE 6.0 or higher and pick a use a device simulator that supports touchscreen (9800 Torch, 9930 Bold and etc…).


    EDIT

    You are initiating local LabelFields and ButtonFields instead of the class’ member variable. All class member variable remained uninitialized (e.g. equal null). You should remove the redundant local variable definitions.

    Update all your LabelFields and ButtonFields in the following way:

    LabelField banner = new LabelField(“Diary”, LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    ButtonField lastWeek = new ButtonField(“<<“, ButtonField.CONSUME_CLICK);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to get my first ASP.NET web page working on windows using Mono
I am attempting to get my first Django project working, on Windows, but I
This is my first blackberry app and I am attempting to make a simple
I'm writing my first app with ASP.NET MVP (attempting Supervisory Controller) and Unit Testing
I'm attempting my first forray into jQuery. I'm trying to acheive the following, though
I'm attempting to get my first hello world rails example going using the rails'
I am attempting to deploy my first app on Heroku and having a little
I am simply attempting to get jquery to identify the first letter of a
I'm creating my first android app (or attempting to anyway) and i have a
I'm attempting to run a RoR app locally for the first time. I've started

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.