[REQUEST] How EditField auto resizing

I have a code...

public class AppMainScreen extends MainScreen implements HttpResponseListener {
    private final String URL = "http://translate.google.com/m?hl=id&sl=id&tl=hi&ie=UTF-8&prev=_m&q=aku+lapar";

    public AppMainScreen(String title) {
        setTitle(title);

        txtHasil = new EditField("", "", EditField.DEFAULT_MAXCHARS, FOCUSABLE);
            add(txtHasil);
    }

    private MenuItem miReadData = new MenuItem("Read data", 0, 0) {
        public void run() {
            requestData();
        }
    };

    protected void makeMenu(Menu menu, int instance) {
        menu.add(miReadData);
        super.makeMenu(menu, instance);
    }

    public void close() {
        super.close();
    }

    public void showDialog(final String message) {
        UiApplication.getUiApplication().invokeLater(new Runnable() {
            public void run() {
                Dialog.alert(message);
            }
        });
    }

    private void requestData() {
        Thread urlReader = new Thread(new HttpUrlReader(URL, this));
        urlReader.start();
    }

    public void onHttpResponseFail(String message, String url) {
    }

    public void onHttpResponseSuccess(byte bytes[], String url) {
        string hasil(""+ new String(bytes));
        txtHasil.setText(hasil);

    }
}

When I select the menu item, read, go out like that

I want to output in editfield

Please help me, im stuck in Editfield... :'(

"OnHttpResponseSuccess()" is called on the event Thread?  Try the following in order to ensure that the update of the field is executed on the event Thread

{public onHttpResponseSuccess Sub (final ubyte bytes [], String url)
UiApplication.getUiApplication () .invokeLater (new Runnable() {}
public void run() {}
txtHasil.setText (new String (bytes));
}
});
}

If this does not work, then please put a try catch around this code to ensure that it is not to throw exceptions.  Let us know what you see.

Tags: BlackBerry Developers

Similar Questions

  • How can I disable auto resizing of tabs?

    Hello

    I love Firefox, but the one that drives me crazy behavior is auto resizing of tabs. I would like to choose a size for the tabs and that the browser to stick at that size for all tabs.

    Ideally I'd like to achieve this without having to install the extensions for the browser. If anyone can help?

    FYI, I use the latest version of Firefox (27.0.1) on a Mac, under the last Mavericks (10.9.2). I tend to keep everything up-to-date.

    Nevermind, I figured it. If someone else asks:

    • In your URL bar, type "subject: config" without the quotes.
    • In the 'search' field upstairs bar, type "tabs".
    • Search for "browser.tabs.animate." By default, the value is set to 'true '. Double-click it, which must be set to "false".

    The value 'false' should fix auto (incredibly annoying) tab resizing. Now, you can continue to use Firefox and enjoy tabs without continuous frustration.

    [relevant picture attached]

  • I did not purchase request how the amount is deducted from my account without my knowledge

    Hello

    1. I did not purchase request how the amount is deducted from my account without my knowledge. I ask you to return the amount to my account

    2. you download the free app and I have not purchased the app, I didn't purchase was deducted without my knowledge

    3. I ask you to bring the amount in my account and I will sue you to withdraw money from my account without my knowledge

    < re-titled by host >

    Maybe it's authorization is to identify yourself, the money will be in a few days.

    Read here: on the payment card's authorization in the iTunes Store - Apple Support

  • How do I resize pictures so I can post them on the forums?

    I have severl photos I want to post to a forum. The forum has size limitations. How can I resize them so that they will meet the requirements?

    Thank you

    EEasiest method is to export Photos to the desktop and then open it in preview (a double-tap on the image files usually throws). Select adjust size in the Tools menu.

  • How can I resize a picture using Picture Manager please?

    How can I resize picture using Picture Manager please? Let's say I want to put 4 x 6 cm for a given photo dimensions. I tried to resize , but is it compresses the picture to send by e-mail etc... It is basically a photo compressor.

    How can I resize picture using Picture Manager please? Let's say I want to put 4 x 6 cm for a given photo dimensions. I tried to resize , but is it compresses the picture to send by e-mail etc... It is basically a photo compressor.

    =============================
    If you are running Windows XP... it is a free software
    The PowerToy that is useful for resizing of the pictures:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Go to the following link and download and
    install: ImageResizer.exe
    http://www.Microsoft.com/windowsxp/downloads/PowerToys/xppowertoys.mspx
    (does not work on Vista)

    Then, you can open any folder containing
    images and you will have an option to resize.
    Just right click the selected image files and
    Choose resize images in the menu. You
    can select a picture or an entire group.

    The program will place the resized in copies
    the folder with your originals.
    (Tip: * never * overwrite your originals)

    To ensure that images in both portrait and
    landscape orientation are resized to the
    same dimensions... go to... Advanced...
    and enter the largest number in these two areas.
    IOW... for 600 x 800... Enter 800 in these two areas.

    (Tip: even if you resize the Photos to the same)
    dimensions (original)... the file size will be greatly
    reduced).

    =====

    If you want to change the proportions of a picture...
    you have to reframe it... otherwise it will be distorted.

    The following freeware has a tool of good harvest.
    Just select a thumbnail and press X to open the
    Council for culture. (Tip: always save your editing / cropped /)
    photos resized under a new name)

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    FastStone Image Viewer
    http://www.FastStone.org/FSViewerDetail.htm

    The following tutorial provides information on the creation of a
    2 "x 2" photo ID, but the steps would be
    basically the same for any size.

    Now, open the program and select (highlight)
    the image you want to change.

    According to... to... Edit / crop Panel (or type... (X)

    Click on the button 'Set Ratios of paper'.
    (it's just to the right of the proportion of paper
    fall of window)

    Click on the 'Add' button and enter... 2 x 2 "
    Click on... OK / OKAY... (this will give you the square
    format you need)

    You can resize the selection frame by dragging
    reposition by dragging corner handles
    the arrow of the 4 channels. At the end... Click on the 'culture '.
    button.

    Now... to... File / save as...
    Choose a backup location, enter a new name for
    the photo and choose a format to save in...
    Left click on the Save"" button.

    =====

    Info about photo manager
    If you resize a photo with Picture Manager and
    save it when you see the dialog box saying:

    "There are changes that have not been saved"

    The original photo will be overwritten (replaced)
    with the rezized version... IOW the original will
    be unrecoverable.

    To keep two versions of the picture, resize it
    and go... File / save as... Enter a new name for
    version resized and on the left, click on the "Save" button.

    When you close the photo manager and see the
    dialog box:

    "There are changes that have not been saved"

    On the left, click the do not save"" button. Now
    have both versions.

    Volunteer - MS - MVP - Digital Media Experience J - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • How can I resize a digital image using software of photo gallery to keep my digital images to be cut during printing on standard paper by a commercial processor? MP

    How can I resize a digital image using software of photo gallery to keep my digital images to be cut during printing on standard paper by a commercial processor? MP

    How can I resize a digital image using software of photo gallery to keep my digital images to be cut during printing on standard paper by a commercial processor? MP

    ====================================
    Sometimes the only resizing is not the answer because the
    the original size is different from the print size.

    You may need to crop photos to the size you want
    print to ensure that no clipping will occur. Cropping
    to a different aspect ratio will lose some parts of the picture but
    at least you have control over it.

    Windows Live Photo Gallery is a cropping tool.

    Volunteer - MS - MVP - Digital Media Experience J - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • More comments: PSD layers &gt; Sketch merged =? Auto-resizing?

    Hello! I wanted to you guys give some more information about the use of sketches.

    I wanted to do a project where I could take a high-resolution picture and superimpose a drawn character in this "scene / photograph.»

    My photo was taken in high resolution with a digital SLR. I was working on a sketch on my Mac Pro in Photoshop. I dropped it in the CC for I can access it on my ipad and continue working on my sketch while I was on the road.

    I noticed that I could not import my photoshop PSD file layers in Photoshop sketch. It is important that the image being merged.

    Are there plans to make this a feature to keep the separate layers? It would be AMAZING that you can do (even if you only limited to a few layers, I don't mind!) Little is better than nothing!)

    Secondly, I also noticed that the original file was 4128 x 2322 pixel, and when I brought in the sketch, it auto - resizes (without letting me know?!) at 2048 x 1536 pixels...

    Is there a way that I was at least able to keep the original in the future if size at least I can work on stuff in a new layer and when I'm home and back to Photoshop, so at least I know it will be the right size?

    There will be a solution for this?

    Are also do you do cancel button and add a button to roll forward / ability?

    Thanks for being awesome. I hope my comments help!

    Alintheayoh,

    15360... typo. I fixed it so it would not confuse everyone. Thanks for catching I meant to type in 1536.

    I know a lot of people would really like it. Like most things, there are a lot of things for the product team to consider before this feature will be brought to the app. But, it is envisaged, is certainly not out of the question. I have just no idea when (or even if) it's going to happen. I would like to have more information for you.

    I thought that's what you hear on Undo/Redo, but I wanted to make sure before answering. There is an Undo icon (I pasted a screenshot below), and if you press and hold down on it, the forward icon. There is also, in this same menu, a calendar icon where you can scroll backwards 50 steps in your drawing (Please be very careful with cancellations and the function of the timeline. If you make a mark on the screen after going on the timeline, it will substitute all your work. You will get a warning that you are about to delete all of your features, but many people ignore the alert and lose their jobs. So be careful.)

    Sue.

  • VMware workstation 11 and Windows 10 build 9926 auto resizing does not

    Host: Windows 8.1 Pro x 64

    VMware: Workstation 11

    Client: Windows 10 Build 9926

    Problem I have is in the guest operating system (win 10).  I can not auto resize the guest to fit the window (now Vmware worksation, opinion, comments made.  It flashes on the full screen, then goes back to the resolution that it is.  I'm stuck at the Windows gives me resolutions.

    I know that this version comes out today.  But I thought I'd give you guys a heads up.

    THX.

    Build 10074 works!

    So, I did a clean install of the new generation (10074).  Workstation makes easy installation on it.  During the easy setup process, it didn't install VMWare tools, but I see the tools have been installed.  I tried to re-size that the screen with 3D powered acceleration; and it worked!

    This issue is finally resolved. !

  • How can I insert a video and how can I resize with Dreamweaver cs5?

    I export a slide show on a Web page. The format will be H.264. But I had problems with the integration of the video using Dreamweaver cs5, then, what are the best measures? Also, I need to make the video smaller than the standard size, so how do I resize as well? Thank you!-Peter Mayer

    Use the HTML5 video tag. You will need to manually code if ' cuz CS5 has no menus for it.  No, they were introduced in DW to the creative cloud CS6 (ver 12.20).

    HTML5 video

    If you want sensitive videos, see my Bootstrap tutorial.

    ALT-Web Design & Publishing: reactive Bootstrap 3 Videos

    Nancy O.

  • How do I resize BOTH the frame AND the image? I used to use the command and shift (to keep the proportions), but NO keys working!

    How do I resize BOTH the frame AND the image?

    I just started using CC online I usually use the command and shift (to keep the proportions), but NO keys work now!

    It's frustrating to have to resize the image and frame separately. The SHIFT key does not keep the proportions more!

    The shortcuts have changed?

    I'm on Macbook Pro - Yosemite.

    Please help me! Thank you!

    In the panel control is a check box resize the content with the framework.

  • The Photoshop window does not fit on my laptop screen. How do I resize for the small screen?

    The Photoshop window does not fit on my laptop screen. How do I resize for the small screen?

    Photoshop window menu > uncheck and then recheck the setting of the Application.

  • How can I resize my tool icons and info bar. It is too small for me to see the good

    How can I resize my tool icons and info bar. It is too small for me to see the good

    Hi nonnoni,

    In Illustrator CC 17.1 update, Illustrator user interface can be resized to 150% and 200%. It is triggerred when you change your screen from Control Panel > 125% scaling and your monitor supports a minimum vertical resolution of 1080 pixels.

    Sanjay.

  • How can I resize window "script event handler?

    How can I resize window "script event handler? (I entered in a script long as event handler script. After adding the script, I can't view or scroll key buttons on the right) .attached is a screenshot of the problem I am facing.a.jpg

    Quit photoshop and go to

    For Photoshop CS6

    Photoshop CS6 Photoshop C:\Users\Your Name\AppData\Roaming\Adobe\Adobe CS6\Adobe settings

    For Photoshop CC

    C:\Users\Your Name\AppData\Roaming\Adobe\Adobe Photoshop CS6\Adobe Photoshop CC settings

    remove the

    Script Manager.xml events

    then restart photoshop


    I think that the events are for something like select menu or tool (filter), and then this, for example.

    For your script, probably add using skip under Script would be preferable.



  • How can I resize a shape tween without that he's looking wonky?

    Hello! I am a beginner in flash animation, although I used it to draw several years before.

    I have a problem that I can't find the answer to the simple. I looked in many places.

    in any case, I have a scene to its default size to 550px x 400px. I thought it would be easy to change later if I don't bother making it larger at the beginning. Now that my drawing is completed, I want to make the biggest scene (of 1024px x 768px) AND stretch the graphics / content on the stage as well as the well adapted to the larger stage. And I want it centered too because it is aligned to the left now when I preview it in my browser. It would be a piece of cake, if I didn't have a shape tween that looks to wind blowing hair in!

    The dilemma is that when I resize the graphic, the shape tween ends as a result of these movements, thinking that it is the part of the animation when it is not supposed to be. My question is how can I resize a shape tween without keyframes following the movements that I do? I want just a larger version of the shape tween, I already have put in place and don't want more bigger / change of position to be part of the animation!

    Help, please. Thank you!

    One of those three things should work:

    1. Try to click the key next to the stage width and height and enter your new width and height, then clicking on 'Scale content with scene.'
    2. In your publishing settings, select "percent" and a percentage higher than 100.
    3. Follow the steps here http://flashthusiast.com/2009/10/06/scaling-and-moving-new-motion-tweens-in-flash-cs4/

    Good luck!

  • How can I make my new Web site auto resize to any size monitor?  Or is there a function I can select or click on which will allow my site on auto size?

    We're almost done with a Web site that we worked on for our company.  We noticed that while it seems to fit perfectly on most of our standard HD monitors, we have still a few who are not HD and know that many of our customers will be the same.  These monitors that are not HD seem cut off from footer and side just a little.

    It is a feature of MUSE that will automatically resize a Web site for the monitor which shows?  If not, how this is done?

    I guess (or hope) you mean that the content of the window (the site) must adapt to the browser window, because you can't force the browser window to adapt (maximize if the user set smaller, or any size on a Mac) on the screen of the computer.

    If it is indeed the adaptation of the content you need, then take a look at all the 'sensitive' news, that the current version of the Muse offers today. Check out the video tutorials and Help pages !

Maybe you are looking for