Slider custom text field (Cap) does not appear

All;

I created a custom text field based on the standard text field, changes work fine (really just a custom height and width and a border).  The problem is the method of painting which seems to remove the cap of the field when it gets the focus.  To be clear the carret never shown at all.

public class CustomText extends TextField //cutom text field width
{
    //Custom Height and Width in Pixels
    final static int textwidth=125;
    final static int textheight=25;

     CustomText()
     {
     super(); // Call the default constructor    

     //Border for text fields
     XYEdges padding = new XYEdges(5, 5, 5, 5); //space between box and border
     Border theborder = BorderFactory.createSimpleBorder(padding, Border.STYLE_SOLID);

     //Assign the border to the object
     this.setBorder(theborder);
     }

     public void onFocus( int direction )
     {
        super.onFocus( direction ); //invoke parent procedure
        invalidate(); //mark for redraw
     }

     public void onUnfocus()
     {
    super.onUnfocus(); //invoke parent procedure
    invalidate(); //mark for redraw
     }

     //Override the layout with the custom Width and Height
     protected void layout(int width, int height)
     {
        super.layout(textwidth,textheight);
        setExtent(textwidth,textheight);

     }      

    //Override the display message such that no message is displayed when the field is full
    protected void displayFieldFullMessage()
    {
    }

    //Override the default paint method to call the super class constructor and then assign the border
    protected void paint(Graphics graphics)
    {
       // int prevColor = graphics.getColor(); //Save Previous Color
        graphics.setBackgroundColor(Color.LIGHTGRAY); // Set to Gray
        graphics.clear(); // Clear for redraw
        super.paint(graphics); //Force Redraw of Object
      //  graphics.setColor(prevColor); //restore for cursor paint

    }

};

In the paint in the first and last method lines that are commented out were a soloution that I tried after reading on this subject.  Something along the lines of the restoration of the default color, but unfortunately without success.   Any ideas would be more useful

Thank you!

Quick thoughts:

(a) to remove the requirement to substitute paint by setting the background a Color.LIGHTGRAY using the base class

(b) you put on the field by using this:

Super.Layout (TextWidth, TextHeight);

If you then do the following:

setExtent (textwidth, textheight);

you are likely to confuse the field.  If you still want to use the entire height and use the full width and then try to deal with it in the Style, that is, replace this:

Super(); Call the default constructor

with this

Super(TextField.USE_ALL_HEIGHT |) TextField.USE_ALL_WIDTH); Call the default constructor

(c) why you override onFocus and onUnfocus?  I would like to delete these if you do not have anything specific to these methods.

Make these changes, and you'll have a more simple TextField.  See if these changes will solve the problem of the caret too.

Tags: BlackBerry Developers

Similar Questions

  • Alternative text for Images does not appear in FF 4 b 2

    When you attempt to view the alt on images for websites text as XKCD, the text, which appears as a ToolTip in the previous version of Firefox, including 4 b 1, does not appear. Help!

    URL of affected sites

    http://xkcd.com

    Problems with ToolTips not working not properly have been reported to be due to the Google toolbar (Tools > Modules > Extensions)

    http://www.Google.com/tools/Firefox/toolbar/FT5/intl/en/
    http://Tools.Google.com/tools/Firefox/toolbar/FT5/intl/en/install.html

    See Troubleshooting extensions and themes and problems of hardware acceleration to resolve common Firefox problems

  • . Linked PSD placed behind the text block. Does not appear in the PDF export?

    So, I have an image as a .psd in my spread which is behind a block of text and a low opacity to ensure readability. However, when I export to PDF, it does not appear in the final file. Any ideas? Thanks in advance for any help.

    EDIT: now I found a work around using a PNG exported from Photoshop instead of the original file. Would be really nice to be able to use the PSD so if changes are to be made to the image, it can be easily updated.

    J

    Hi Justin,

    HM, then you must make a tough decision, your only choice to be on the "safe" side

    Export to PDF v1.3 (Compatibility Acrobat 4 (PDF 1.3) where you check "simulate overprinting" in the fourth tab of the settings of export PDF.

    This workflow is not recommended for PDF files you want to print:

    Just for the screen display!

    Then all the 'overlay' and 'transparency' is cooked in the PDF file so to speak.

    Here is a screenshot of my German OS:

    Uwe

  • BlackBerry Smartphones Custom Dictionary, machine learning does not appear in the dictionary.

    My phone automatically learned a lot of bad words, I typed in Miss.  On my old 8100 PEARL I just go into the custom dictionary and delete them.  On my 8200 they do not appear in the list at all.

    Show words that I entered manually, but I can't remove words that have been learned by phone.

    The more I use the phone, it becomes more unusable

    I upgraded to a TOWER.  Scoring of the question, but not the solution I was looking for.  HAH!

  • Text field calculates does not correctly

    In Acrobat Pro XI.

    I created an order form which does not calculate correctly. If you refer to the image below (sorry for the bad calligraphy), the items are marked as follows:

    F1 - Visible, Fillable field by the guest. Guest selects the quantity demanded

    F2 - hidden field, simplified field notation (price in this case)

    F3 - hidden field (now visible to the post), the value is the PRODUCT of F1, F2

    CT1 - hidden field (now visible for this post), the value is the SUM of all selected items in the category (there are several categories in the form)

    ST1 - hidden field (now visible for this post), the value is the TOTAL/subtotal of all categories

    Of after the news above, ST1 should correspond to the same thing as CT1, but for some reason any the first line (braised short ribs) does not calculate in ST1. On the screenshot 2, the first element is not selected, but ST1 value has increased the amount of F2, while the value of CT1 is correct.

    Altogether, there are more than 300 + calculations which 99% of them work properly and with similar formulas. I deleted and then recreated ST1, but that because of the other categories to have errors in the calculations. I have created other forms to similar problems and can't find a determination to my questions.

    Any help will be MUCH appreciated.

    Capture.JPG1.JPG

    This is often due to a wrong field calculation order. How do you define this depends on which version of Acrobat you are using, but for Acrobat 11 you would select:

    Tools > forms > change

    and then: tasks > other tasks > set field calculation order

  • My Apple Watch gets my texts & SMS but does not appear on my iPhone its synchronized with

    This happens not all the time but it's embarrassing seriously. I check my phone before I check my watch. Sometimes, the watch will get all my text messages and my iPhone will miss 1 - 3 on the texts but my watch will bring them. But my watch told me that they got their. So I finished due to lack of texts cause his were not on my iphone6 I tied him to the watch. This is a business so phone when I'm bored of texts cost me money. So, how can I fix this so that the matched iPhone becomes all messages text as it used to. I had to make sure to check that my iwatch first before my phone and for me that is very annoying. As I want my phone to be the main thing I text of.  Can anyone help?

    Hello

    How notifications behave depends on the State of your devices. In order to provide notifications to your attention as soon as possible:

    -If your iPhone is unlocked, you will receive notifications on your iPhone instead of on your watch.

    -If your iPhone is locked or mode and your watch is unlocked (regardless of the question of whether the screen saver is awake or asleep) and on your wrist, you will receive notifications on your watch.

    -If your watch is locked or allowed to do not disturb, notifications will be sent to your iPhone.

    More information:

    About notifications on your Apple Watch - Apple Support

  • Multiline text field where does not align data entry

    I ran into this many times and I have not be able to find a solution. I work with an existing paper form that has a descriptive text on the left that partially fills a line. At the end of the sentence, the line is half-filled and the entrance area starts immediately thereafter. The continuous form then allow text entry, but now line 2 is entirely justified to the left. Here is an attempt of a Visual:

    Tell us a lot about yourself: _

    ________________________________________________

    ________________________________________________

    If I put a large box on all three lines that is framed on the left, then the seizure highlighted area covers the text of the question, and the values that are entered in the box to write on top of the text.

    If I put the box on the right, any input is limited and seems weird when printing.

    I have always just made two text boxes. A short and the other who will the width and the text wrapping. I hate to run, but I wanted to make sure that my question has been understood. Thanks for the ideas you have there

    It is the only possible solution.

  • expnds of expandable text field, but does not go to the second page, why?

    Hello

    After working hours and read blogs, I was able to create a form with several fields stretch.

    the problem is that they aren't going to the second page. they will be cut off and sometimes everything is moving to a second page and I have a blank page first.

    Help, please.

    I need to talk to happen when I use tables in my forms. simple text will be more flow to the next page very well.

    The problem when there are tables

    Send the form and a description of the problem to [email protected] and I'll have a look when I get the chance.

    Paul

  • Calculate my text field properties does not work.

    Why this feature could stop working? I uninstalled Adobe Acrobat 9 and reinstalled twice now and still not get this to work.

    Can you give us some information? What exactly you are trying to do, and what are the results?

    In addition, Acrobat 9 is quite an old version and is not compatible with the new operating systems (like Windows 8 and 10).

  • I use Google's DoubleClick for publishers to track clicks on outgoing links on a text link. My text ad and link does not appear in FireFox 3.6.15.

    I use Google's DoubleClick for publishers to track the clicks-through on outgoing links. I have text ads and banner ads on my site.

    (DoubleClick for Publishers is here: https://www.google.com/dfp/info/welcome.html)

    I made an announcement of text with a link to text site Web DoubleClick for publishers. The announcement of text present in IE and Chrome, but doesn't show in FireFox 3.6.15.

    To see the problem go to: http://www.helicopterlinks.com. See three columns of helicopter companies listed on this page.

    Very high to the left of the three columns is empty, in FireFox 3.6.15. It is hence is the followed DFP ad text and advertising does not appear. The announcement of text present in IE and Chrome.

    Advertising works using JavaScript. I've just updated my JavaScript on my computer and that the announcement still does not work.

    It is a serious problem. According to my Google Analytics account, January 1, 2010 - March 5, 2011, 24.03% of people who visit my site using FireFox.

    If someone will please email me with updates, I would appreciate it.

    Try announcement Web development / standards evangelism MozillaZine forum. The helpers there are better informed on the problems of development of web page with Firefox.

    http://forums.mozillazine.org/viewforum.php?f=25

    You will need to register and log in to post in this forum.

  • When I create a button "submit" text "Submit" does not appear on the actual button.

    When I create a button "submit" text "Submit" does not appear on the actual button. Anyone know what is the problem?

    Depends on how you file the form. In Acrobat, it has a property to set the appearance of the button. In AA 8, field properties appear as below:

    It may vary in other versions (I on other machines), but the basic idea is the same. Need to add the label.

  • the custom words does not appear in my iPhone

    Hello

    I joined my iPhone IOS 10 6 more and I noticed that the custom words does not appear in my iPhone, even if I have them in my iTunes library. I signed up with the same Apple ID on all devices. Very few of them, I can access the lyrics in my phone, but not all of them (as he used to be in iOS 9)

    any help is appreciated.

    Thank you

    Ahmed

    I downloaded a program on my Mac (no app store unfortunately) called "get lyrical". automatically add lyrics to iTunes. Then in iTunes file > library > Update music library to iCloud. doing this during the last 20 minutes and so far it seems to work.

  • My addons page does not appear any content or text

    Hello
    My addons page does not appear any content or text.

    Snapshot is in the link given below.
    http://I57.Tinypic.com/2vwek3n.PNG

    Start Firefox in Safe Mode {web link}
    While you are in safe mode;
    Press Alt or F10 to bring up the toolbar.
    Followed;

    Windows; Tools > Options
    Linux; Edit > Preferences
    Mac; name of the application > Preferences

    Then Advanced > General.
    Find and stop using hardware acceleration.

    Search web sites secure. Are there problems?

    Then restart.

  • My Apple Watch does not turn off.  When I go to turn off the slider isn't in the article to stop, I can restart but the cursor still does not appear

    My Apple Watch does not turn off.  When I go to turn off the slider isn't in the article to stop, I can restart but the cursor still does not appear

    Hello

    It is not possible to disable Apple Watch when its on the charger and connected to the power supply - this is normal.

  • my name does not appear when I send a text

    Hi-

    I have a 5 c iphone / ios 7.1.2 and when I send a SMS my name does not appear on the sent message (in other words when I send a text message to the recipient doesn't know who he is).

    I might have changed inadvertently one of the settings, but can't seem to figure out what I changed or where I changed it.

    Do you have thoughts about what GHTS wrong?

    Thank you

    Nicole

    This has nothing to do with your device, which is at the end of the receiver. They are the one that is to put your name in contacts for what appears on their device. What happens when you send a message is your phone number is sent and their camera captures these credentials to the appellant and that you appear in their contact list, your name appears. Have your friend check their contacts on their device.

Maybe you are looking for