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
New Developer
Posts: 133
Registered: ‎12-31-2009
My Device: Not Specified

Problem of scrolling in paint (MainScreen)

Hello Friends,

 

I have developed a registration screen using MainScreen. It works fine. Now I want my background to be in any color (lets say.. yellow). So, for this, I use " paint " method. My code is as follows to acheive this. It also works (i.e. it displays the screen with yellow background) but the scrolling is disabled now. I mean to sayscrolling is not taking place. What may be the problem?? I have two BBs.

1)  9700

2) 8100

 

In 9700 the screen size is largh enough so all components are displaying in single screen so no scrolling is required. But in 8100, screen size is small so some compnents are not getting displayed at first screen so scrolling is required and here I face problem of scrolling

 

Please let me know If I am wrong somewhere or I am missing something in my code.

 

 

 

		class Registration
		{

		public void paint(Graphics graphics)
		{
		graphics.setBackgroundColor( Color.YELLOW);
		graphics.clear();

		subpaint(graphics);
		this.invalidate();

		}

		public Registration(MyUiClass Uiapp)
		{

			super(Field.USE_ALL_WIDTH | Field.USE_ALL_HEIGHT | Field.FIELD_LEFT
			| Field.FIELD_TOP |Manager.VERTICAL_SCROLL |Manager.HORIZONTAL_SCROLL);

			this.Uiapp = app;
			LabelField title = new LabelField("Registration",LabelField.ELLIPSIS |LabelField.USE_ALL_WIDTH| LabelField.FIELD_HCENTER)
			{
			public void paint(Graphics g) {
			g.setBackgroundColor(Color.YELLOW);
			g.clear();

			g.setColor(Color.GREEN);
			super.paint(g);
			invalidate();

							}
			};
		add (title);

			LabelField serverUriLabel = new LabelField("UserName:",
			LabelField.USE_ALL_WIDTH)
			{
			public void paint(Graphics g) {
			g.setBackgroundColor(Color.WHITE);
			g.clear();
			g.setColor(Color.BLACK);
			super.paint(g);
			invalidate();
			}
			};
		add(serverUriLabel);


		RegiPhoneNo = new EditField("", "");
		add(RegiPhoneNo);

			LabelField emailUriLabel = new LabelField("Password:",
			LabelField.USE_ALL_WIDTH) {

			public void paint(Graphics g) {

			g.setBackgroundColor(Color.WHITE);
			g.clear();

			g.setColor(Color.BLACK);
			super.paint(g);
			 invalidate();

			}
			};
		add(emailUriLabel);

		emailPhoneNo = new EditField("", "");
		add(emailPhoneNo);

			LabelField RegistrUriLabel = new LabelField("Name:",
			LabelField.USE_ALL_WIDTH) {

			public void paint(Graphics g) {

			g.setBackgroundColor(Color.WHITE);
			g.clear();

			g.setColor(Color.BLACK);
			super.paint(g);
			invalidate();

			}
			};
		add(RegistrUriLabel);


		Registrationkey = new EditField("", "")
		add(Registrationkey);



			LabelField emailUriLabel2 = new LabelField("Email:",
			LabelField.USE_ALL_WIDTH) {

			public void paint(Graphics g) {
			g.setBackgroundColor(Color.WHITE);
			g.clear();
			g.setColor(Color.BLACK);
			super.paint(g);
			invalidate();

			}
			};
		add(emailUriLabel2);

		emailPhoneNo2 = new EditField("", "") ;
		add(emailPhoneNo2);

		Uiapp.pushScreen(this);
		}

		}

 

 

 

 

 

Developer
Posts: 101
Registered: ‎07-20-2009
My Device: Not Specified

Re: Problem of scrolling in paint (MainScreen)

Hi Ganesh,

 

I am also a newbie in Blackberry development. But in your code you have given a call to invalidate from the paint method. AFAIK, invalidate method again gives a call to paint method.

 

May be your problem is because of this reason. Not sure though...Smiley Happy

New Developer
Posts: 133
Registered: ‎12-31-2009
My Device: Not Specified

Re: Problem of scrolling in paint (MainScreen)

Hello Karan,

 

Thank you for your sugesstion. I will give it a try. And one more thing, I am also new in BB.

So, I am also in learning phase.

Smiley Happy

 

 

 

Thank you

 

 

 

New Developer
Posts: 133
Registered: ‎12-31-2009
My Device: Not Specified

Re: Problem of scrolling in paint (MainScreen)

Hello Karan,

 

I had given it a try but it is not working.Let me know if any other sugesstion.

 

 

 

 

Thank you

New Developer
Posts: 133
Registered: ‎12-31-2009
My Device: Not Specified

Re: Problem of scrolling in paint (MainScreen)

Hello Friends,

 

 

Please suggest me some breakthrough for this problem

 

Thank you