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
Posts: 141
Registered: ‎08-06-2008
My Device: Not Specified

To make underlined text

Hi all,

 

I need some help for making underlined LabelField.

And I want make that Labelfiled be highlighted when the trackball is moved over the field.

And do some action like buttonfield when trackball is clicked.

 

How can I do this?

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: To make underlined text

See the API documents for ActiveRichTextField

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: To make underlined text

Is this a start?

 

 

LabelField lab = new LabelField("test",Field.FOCUSABLE) { protected boolean navigationClick(int status, int time) { Status.show("Clicked"); return true; } };

 

 

 

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: To make underlined text

I guess I misunderstood the post?

 

Sounded to me like he wanted to simulate a hyperlink/activetext area within a text field.

 

Either way, a quick look at the API docs might improve the quality of the question.   Smiley Indifferent

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: To make underlined text

RexDoug, I'm not sure that you did.  The original poster has the opportunity to clarify his question and we can follow your suggestion or mine, or perhaps a combination!
Highlighted
Developer
Posts: 141
Registered: ‎08-06-2008
My Device: Not Specified

Re: To make underlined text

RedDoug,

 

Thanks for your help.

Somehow I had trouble using ActiveRichTextField with network, so I solved the issues with LabelField.

 

private LabelField forgotPasswd = new LabelField("Forgot Password?",LabelField.FOCUSABLE| LabelField.FIELD_LEFT ) { public void paint(Graphics g) { String str1="Forgot Password?"; Font _font = Font.getDefault(); int str_x = _font.getAdvance(str1); g.setColor(0x0054a6); g.drawRect(0,this.getHeight()-2,str_x,2); super.paint(g); } };

I'm using ActiveRichTextField in other area. Thanks.