Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Trusted Contributor
Posts: 204
Registered: ‎07-03-2011
My Device: Torch
My Carrier: Digicel
Accepted Solution

New Options box

Hello,

 

I've just started doing Blackberry applications about a week ago. So I'm really new to this.

 

I want to create a button that when clicked creates a mini screen that partially covers the previous screen. I'm not sure what it's called; either a splash or popup screen. Anyway, I don't know how to do that; any help please? 

_______________________________________________________
Never be close-fisted with the knowledge you've received. For if others were the same to you, you would not be painted as the person you are; the flowing definition of you, would be non existent.

You would be meaningless.
Contributor
Posts: 48
Registered: ‎05-26-2011
My Device: Bold 9700
My Carrier: Telkomsel

Re: New Options box

You may take a look at PopUpScreen  , it's very similar with MainScreen but possible to create transparent background so you could see the screen behind its.

Trusted Contributor
Posts: 204
Registered: ‎07-03-2011
My Device: Torch
My Carrier: Digicel

Re: New Options box

Now we're talking.

I however hate to sound like a nuisance. But I'd love an explained example. Oh please please. It doesn't have to be anything complicated.

Oh please
_______________________________________________________
Never be close-fisted with the knowledge you've received. For if others were the same to you, you would not be painted as the person you are; the flowing definition of you, would be non existent.

You would be meaningless.
Contributor
Posts: 48
Registered: ‎05-26-2011
My Device: Bold 9700
My Carrier: Telkomsel

Re: New Options box

[ Edited ]

Calm down, don't let this problem take you down, my friend. Hope this could cold down your head.

 

public class TheApps extends UiApplication implements FieldChangeListener {

	// MAIN METHOD
	public static void main(String[] args) {
		new TheApps().enterEventDispatcher();
	}

	// THE APPS

	private MainScreen screen;
	private ButtonField button;
	private MyPopUp popUp;

	// CONSTRUCTOR
	public TheApps() {
		popUp = new MyPopUp();
		screen = new MainScreen();
		button = new ButtonField("Click Me", ButtonField.CONSUME_CLICK);
		button.setChangeListener(this);

		screen.add(button);
		pushScreen(screen);
	}

	// ACTION PERFORMED
	public void fieldChanged(Field field, int context) {
		popUp.show();
	}

	// POP UP CLASS
	protected class MyPopUp extends PopupScreen implements FieldChangeListener {

		// POP UP CONSTRUCTOR
		public MyPopUp() {
			// You should delegate some manager to handle
			// layout of this PopUpScreen.
			super(new VerticalFieldManager());

			// Create transparent background
			Background bgTransparent = BackgroundFactory
					.createSolidTransparentBackground(0, 0);

			// Set transparent background as this background
			setBackground(bgTransparent);

			// Create transparent border
			Border bdTransparent = BorderFactory.createSimpleBorder(
					new XYEdges(), Border.STYLE_TRANSPARENT);

			// set transparent border
			setBorder(bdTransparent);

			// add component 
			Bitmap bitmap = Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION);
			BitmapField bitmapField = new BitmapField(bitmap, FIELD_HCENTER);

			add(bitmapField);

			ButtonField button = new ButtonField("Hide Me",
					ButtonField.CONSUME_CLICK | FIELD_HCENTER);
			button.setChangeListener(this);

			add(button);
		}

		// POP UP ACTION PERFORMED
		public void fieldChanged(Field field, int context) {
			hide();
		}

		// SHOW POP UP
		public void show() {
			pushScreen(this);
		}

		// HIDE POP UP
		public void hide() {
			popScreen(this);
		}

		protected boolean keyChar(char c, int status, int time) {
			// when you press escape/back
			if (c == Characters.ESCAPE) { 
				hide();
				return true;
			} else {
				return super.keyChar(c, status, time);
			}
		}
	}
}

 

 

 

Trusted Contributor
Posts: 204
Registered: ‎07-03-2011
My Device: Torch
My Carrier: Digicel

Re: New Options box

You my friend are AWESOME!
_______________________________________________________
Never be close-fisted with the knowledge you've received. For if others were the same to you, you would not be painted as the person you are; the flowing definition of you, would be non existent.

You would be meaningless.
Trusted Contributor
Posts: 204
Registered: ‎07-03-2011
My Device: Torch
My Carrier: Digicel

Re: New Options box

Um bro there are a few errors in this that I don't understand.

_______________________________________________________
Never be close-fisted with the knowledge you've received. For if others were the same to you, you would not be painted as the person you are; the flowing definition of you, would be non existent.

You would be meaningless.
Trusted Contributor
Posts: 204
Registered: ‎07-03-2011
My Device: Torch
My Carrier: Digicel

Re: New Options box

The error is that I have unimplemented methods.

 

Right at the first line..It says that..Why may I ask please?

 

public class MyApp extends UiApplication implements FieldChangeListener

{

_______________________________________________________
Never be close-fisted with the knowledge you've received. For if others were the same to you, you would not be painted as the person you are; the flowing definition of you, would be non existent.

You would be meaningless.
Trusted Contributor
Posts: 204
Registered: ‎07-03-2011
My Device: Torch
My Carrier: Digicel

Re: New Options box

Nope nope..I was wrong
_______________________________________________________
Never be close-fisted with the knowledge you've received. For if others were the same to you, you would not be painted as the person you are; the flowing definition of you, would be non existent.

You would be meaningless.