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

Reply
Developer
SivaR
Posts: 75
Registered: ‎02-08-2010
My Device: 9000

Re: How to create a notepad kind of multiline editor

Thanks for your explanation

 

I tried using Manager.VERTICAL_SCROLLBAR, but still I am not seeing any Scroll bar.

 

Thanks

Siva

 

Thanks
Siva
Developer
SivaR
Posts: 75
Registered: ‎02-08-2010
My Device: 9000

Re: How to create a notepad kind of multiline editor

Hi

Can any one please help on having vertical scroll bar in the said Multiline Editor.

 

Thanks

Siva

Thanks
Siva
Developer
mlisaoverdrive
Posts: 179
Registered: ‎09-11-2009
My Device: Not Specified

Re: How to create a notepad kind of multiline editor

Did you try implenting the vertical scroll bar in a field other than Manager?  Also, do you need the scroll bars if the field will scroll on its own?

Developer
SivaR
Posts: 75
Registered: ‎02-08-2010
My Device: 9000

Re: How to create a notepad kind of multiline editor

Hi

I want to have a scroll bar inside my Multiline Text Editor. Can you please send the code for the same.

 

Thanks

Siva

Thanks
Siva
Developer
zany
Posts: 222
Registered: ‎11-11-2009
My Device: Storm

Re: How to create a notepad kind of multiline editor

I think following KB article will be useful to you

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800345/...

with regards,
Vignesh J

-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Don't forget to mark your post as solved if you get the answer and dont forget to give kudos if the answer is useful for you.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Developer
belberry
Posts: 265
Registered: ‎08-27-2009
My Device: Not Specified

Re: How to create a notepad kind of multiline editor

for u r note pad thing try the below code. create a CAutoTextBox.java file and paste the below code and in your code where u want this note pad just create a variable of AutoTextEditField txt;  and

 

txt = new CAutoTextBox("",AutoTextEditField.FIELD_HCENTER);

 

 

import net.rim.device.api.ui.component.*;

public class CAutoTextBox extends  AutoTextEditField {
    public CTextBox() {    }
    
    public CTextBox(String text,long Style)
    {
       super("","",400,Style);
    }  
    
    protected void paintBackground(Graphics g) 
    {
      
       g.drawRect(1,0,315,this.getHeight());       
        g.setColor(Color.BLACK);
      
    } 
} 

 

Developer
belberry
Posts: 265
Registered: ‎08-27-2009
My Device: Not Specified

Re: How to create a notepad kind of multiline editor

was it usefulyy for u in any means....

Developer
SivaR
Posts: 75
Registered: ‎02-08-2010
My Device: 9000

Re: How to create a notepad kind of multiline editor

Zany

I use the same code mentioned by your Link and end up in a Rectangular Edit Field which is scrollable, but there is NO SCROLL BAR on right side.

I want to have SCROLL BAR on the right side of the editor.

 

Belberry

Your solution is same as using AutoTextEditField

 

 

Thanks
Siva
Developer
zany
Posts: 222
Registered: ‎11-11-2009
My Device: Storm

Re: How to create a notepad kind of multiline editor

It is not possible to show scroll bar for Edit Field. One of the features of Edit Field is auto grow, ie., once the text entered is going behind its height, it will start growing vertically automatically, so vertical scroll bar will not be shown any time since it is keep on growing. If it is mandatory to have scroll bar, then you have add your own scroll bar. But i think, it will be hard to handle it

with regards,
Vignesh J

-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Don't forget to mark your post as solved if you get the answer and dont forget to give kudos if the answer is useful for you.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Developer
huddarveena
Posts: 103
Registered: ‎12-12-2011
My Device: Developer

Re: How to create a notepad kind of multiline editor

Thank you for the code @SivaR, it helped me out to get solution to similar problem I had.