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 5843121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:06:37+00:00 2026-05-22T12:06:37+00:00

I have an AbsoluteFieldManager that contains several Fields in a horizontal row, switching the

  • 0

I have an AbsoluteFieldManager that contains several Fields in a horizontal row, switching the focus works fine. Now i need to add another Field on the same horizontal position as the left field above. When doing so, I can no more focus the first field. The screen should look as this:

________________________
|  ____   ____   ____  |
| |_f1_| |_f2_| |_f3_| |
|  ____                |
| |_f4_|               | with f4 added here, f1 isn't focusable, once it has
|______________________| lost focus.

If you got any Ideas how to fix this, I’d apreciate. Here is my Code so far:

TestScreen:

import net.rim.device.api.system.Display;
import net.rim.device.api.ui.container.AbsoluteFieldManager;
import net.rim.device.api.ui.container.MainScreen;

public class TestScreen extends MainScreen {
    int screenY = Display.getWidth();
    int screenX = Display.getHeight();

    public TestScreen() {
        AbsoluteFieldManager manager = new AbsoluteFieldManager();
        TestField f1 = new TestField(50, 50, true);
        TestField f2 = new TestField(50, 50, true);
        TestField f3 = new TestField(50, 50, true);
        TestField f4 = new TestField(50, 50, true);
        TestField f5 = new TestField(50, 50, false);
        manager.add(f1, 0, 0);
        manager.add(f2, 60, 0);
        manager.add(f3, 120, 0);
        manager.add(f4, 180, 0);
        // this works fine: 
        // manager.add(f5, 1, 80);
        // this not:
        manager.add(f5, 0, 80);
        add(manager);
    }
}

TestField:

import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Graphics;


public class TestField extends Field {
    boolean isFocusable;
    int width, height;
    int bgColorUnfocused, bgColorFocused;
    public TestField(int width, int height, boolean isFocusable){
        this.width=width;
        this.height=height;
        this.isFocusable=isFocusable;
        bgColorUnfocused= 0xC0C0C0;
        bgColorFocused = 0x3956F7;
    }
    protected void layout(int w, int h) {
        setExtent(width, height);
    }
    public boolean isFocusable() {
        return isFocusable;
    }
    protected void paint(Graphics g) {
        g.setColor(isFocus() ? bgColorFocused : bgColorUnfocused);
        g.fillRect(0, 0, width, height);        
    }

}

TestApp:

import net.rim.device.api.ui.UiApplication;


public class TestApp extends UiApplication{
    TestScreen screen = new TestScreen();
    public static void main(String args[]){
        TestApp app = new TestApp();
        app.enterEventDispatcher();
    }
    public TestApp(){
        pushScreen(screen);
    }
}
  • 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-22T12:06:38+00:00Added an answer on May 22, 2026 at 12:06 pm

    Since AbsoluteFieldManager isn’t really sure where you’re placing items, it doesn’t know what order to send focus when using the trackwheel. If you want to manage this, ovveride nextFocus(int, int) of the AFM so you can specify who gets the focus based off of where it is and where the intended movement is.

    Take a look at http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/ui/Manager.html#nextFocus(int,%20int) for more details.

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

Sidebar

Related Questions

Have a fun issue with sharepoint calendar view filtering. That code works fine: SPSecurity.RunWithElevatedPrivileges(delegate()
**Have it working now. I forgot to populate the Array List. How embarrassing. I'm
Have searched the database but need to specifically sum(of hours flown or days off)in
Have a bunch of WCF REST services hosted on Azure that access a SQL
Have a photography site that I want to prevent image copying from. How can
Have a script to add / remove options from a select field -- the
Have some dates in my local Oracle 11g database that are in this format:
Have an app that can use tts to read text messages. It can also
Have a bunch of classes which I need to do serialize and deserialize from/to
Have you ever tried working with a XAML file which contains thousand tons of

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.