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
Regular Contributor
Posts: 94
Registered: ‎02-27-2010
My Device: rien
My Carrier: etudiant
Accepted Solution

edit field cursor

 


 

hi 

 Here is a code that I want to change a editfield and insert a picture on which I want to write the data

 

 

         EditField yu = new EditField("AZERTy147 ", "") {
        	        	  
        	  protected void paint(Graphics g) {
        		
        Bitmap yy =	Bitmap.getBitmapResource("inputtt.png");
             
                  g.drawBitmap(100,10, yy.getWidth(),yy.getHeight(),yy, 0, 0);
            		  g.setColor(Color.BLUE);
            		  g.drawText("azerty1474 ", 10, 0);
            		 
            
        	  
        	  public void layout( int maxWidth, int maxHeight )
	            {
	            // int width = Display.getWidth();
	            //  int height = Display.getHeight();
	                super.layout(300, 100);
	              
	                setExtent( 300, 100);
	            }
         };
         myScreen.add(new LabelField(" "));
         myScreen.add(yu) ;

 the problem, I can not find the cursor to write ??

 

 

Regular Contributor
Posts: 94
Registered: ‎02-27-2010
My Device: rien
My Carrier: etudiant

Re: edit field cursor

I want to get  this

1690i48C3ACD3211B707D

Developer
Posts: 174
Registered: ‎08-20-2008
My Device: Not Specified

Re: edit field cursor

Do you have the original png image to test with?

Regular Contributor
Posts: 94
Registered: ‎02-27-2010
My Device: rien
My Carrier: etudiant

Re: edit field cursor

yes, here is the png image

 

1691i45A6153FBFE2F86C

Regular Contributor
Posts: 94
Registered: ‎02-27-2010
My Device: rien
My Carrier: etudiant

Re: edit field cursor

is a white image, you can not s1692iB1D153BB33CBDC1Fee, right click with the mouse to click on below and save image as

Developer
Posts: 174
Registered: ‎08-20-2008
My Device: Not Specified

Re: edit field cursor

Here you go. Should work on all modern day devices but only tested on 9000 sim.

 

 

EditField yu = new EditField("AZERTy147 ", "") {
                public void paintBackground(Graphics g) {
                   Bitmap yy = Bitmap.getBitmapResource("inputtt.png");
                   g.drawBitmap(100,0, yy.getWidth(),yy.getHeight(),yy, 0, 0); 
                }
               public void layout( int maxWidth, int maxHeight )
                {
                super.layout(300, 100);
                 setExtent( 300, 100);
              }
         };

 

 

 

 

Regular Contributor
Posts: 94
Registered: ‎02-27-2010
My Device: rien
My Carrier: etudiant

Re: edit field cursor

thank you 

but how can I change the cursor position

Developer
Posts: 174
Registered: ‎08-20-2008
My Device: Not Specified

Re: edit field cursor

Do you mean in relation to the input area or the image?

Developer
Posts: 723
Registered: ‎03-12-2009
My Device: Playbook

Re: edit field cursor

Override drawFocus method of the field to draw your own cursor.

 

There is a method to get cursor position to know where to draw it.

Regular Contributor
Posts: 94
Registered: ‎02-27-2010
My Device: rien
My Carrier: etudiant

Re: edit field cursor

give me an example or link that helps me