EditField event

I made a connection by extending the EditField. It's getting focus when select. When I click ball control or the enter key, no event fires.

I need to show a few different screen when the user clicks on that click. How to do this?

Thanks for any help.

You can replace Screen.navigationClick () of the getFieldWithFocus() to determine if your domain has been clicked.

Tags: BlackBerry Developers

Similar Questions

  • -MultimediaDemo - sample.MP4 (n00b) could not be found

    Hello! I'm a n00b here, so please forgive the stupid question...

    I'm trying to get the sample working MultimediaDemo, and I am pulling my hair out trying to get the Simulator to find the sample.mp4 file.

    When I debug I get error: CAFETERIA: sample.mp4 is not found

    When he tries to run: getResourceAsStream("/sample.mp4") (complete code below)

    My folder structure is:

    .. Mm2/src/com/rim/samples/multimediademo/MultimediaDemo.Java

    .. Mm2/src/com/rim/samples/multimediademo/sample.MP4

    Issues related to the:

    1. where should I put the sample.mp4 file so that it is? (I tried almost everywhere I can think of, without success..)

    2. where on a real BB the "correct" location corresponds to?

    Thank you

    Tom

    p.s. I read the ref lang (below) and I still don't understand...

    getResourceAsStream

    public InputStream getResourceAsStream(String name)
    

    Looking for a resource with a given name. This method returns null if no resource with this name is found. The rules looking for resources associated with a given class are specific profile. RIM implementation notes: this method searches the resource from the directory in which the current JDP project file is located. By default, it is assumed that this JDP file resides in the parent directory of the package of the current project space. Thus, the package space tree (for example, com/rim/PackageName) is added to name so that the search begins from this space package, that is, in the source directory of the current project. However, if the current JDP project file does not lie in its presumed location, the behavior above prevent the resource located. In this case, the user must add a slash (/) in the name of the resource before calling getResourceAsStream. This treats the name as an absolute path, which is compared to a tree whose root is the location of the JDP file.

    package com.rim.samples.multimediademo;
    
    /** * MultimediaDemo.java * Copyright (C) 2001-2008 Research In Motion Limited. All rights reserved. */import java.io.InputStream;
    
    import javax.microedition.media.Manager;import javax.microedition.media.MediaException;import javax.microedition.media.Player;import javax.microedition.media.PlayerListener;import javax.microedition.media.control.VideoControl;import javax.microedition.media.control.VolumeControl;
    
    import net.rim.device.api.system.Characters;import net.rim.device.api.ui.Field;import net.rim.device.api.ui.MenuItem;import net.rim.device.api.ui.UiApplication;import net.rim.device.api.ui.component.Dialog;import net.rim.device.api.ui.component.EditField;import net.rim.device.api.ui.component.LabelField;import net.rim.device.api.ui.component.Menu;import net.rim.device.api.ui.container.MainScreen;
    
    public final class MultimediaDemo extends UiApplication {    public static void main(String[] args)     {        //create a new instance of the application        //and start the application on the event thread        MultimediaDemo theApp = new MultimediaDemo();        theApp.enterEventDispatcher();    }
    
        public MultimediaDemo()     {        //display a new screen        pushScreen(new VideoScreen());    }}
    
    //create a new screen that extends MainScreen, which provides//default standard behavior for BlackBerry applicationsfinal class VideoScreen extends MainScreen implements PlayerListener{    //declare variables for later use    private Player _player;    private VideoControl _videoControl;    private VideoManager _videoManager;    private Field _videoField;    private EditField _eventField;    private EditField _volumeField;    private int _currentVolume; 
    
        public VideoScreen()     {        //invoke the MainScreen constructor        super();        // add a screen title        LabelField title = new LabelField("Multimedia Demo 2",                        LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);        setTitle(title);
    
            //display Player events          _eventField = new EditField("Event: ","",40,EditField.READONLY);        add(_eventField);
    
            //Initialize _currentVolume        _currentVolume = 50;
    
            //display current Player volume        _volumeField = new EditField("Volume: ",""+_currentVolume,20,EditField.READONLY);        add(_volumeField);
    
            try         {            //Get local video file resource            Class playerDemoClass = Class.forName("com.rim.samples.multimediademo.MultimediaDemo");            InputStream inputStream = playerDemoClass.getResourceAsStream("/sample.mp4");
    
                //Create a new Player from the InputStream            _player = Manager.createPlayer(inputStream,"video/mp4");
    
                //Realize Player            _player.realize();
    
                //Add listener to catch Player events             _player.addPlayerListener(this);
    
                //Get the Player VideoControl            _videoControl = (VideoControl) _player.getControl("VideoControl");
    
                //Initialize video display mode             _videoField = (Field) _videoControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE,"net.rim.device.api.ui.Field");
    
                //Set the video display size to 200 x 200            _videoControl.setDisplaySize(200, 200);
    
                //Create a manager for the video field            _videoManager = new VideoManager();            _videoManager.add(_videoField);            add(_videoManager);
    
                //Set video control to visible            _videoControl.setVisible(true);
    
                //Start the Player            _player.start();
    
                //Set up Player volume            setVolume(_currentVolume);        }         catch (Exception e)         {            System.out.println("foo" + e.getClass());        }    }
    
        //override onClose() to cleanup Player resources and display a dialog box    //when the application is closed    public boolean onClose()    {        //Cleanup Player resources         //try block         try         {            //Stop Player            _player.stop();        }        //catch MediaException        catch (MediaException e)         {            e.printStackTrace();        }
    
            if (_player != null)         {            //Close Player            _player.close();            _player = null;        }        Dialog.alert("Goodbye!");        System.exit(0);        return true;    }
    
        //set the volume level for the Player    private void setVolume(int level)     {        //get the Player volume control and set the volume level        VolumeControl volumeControl = (VolumeControl) _player.getControl("VolumeControl");        volumeControl.setLevel(level);
    
            //Update _volumeField        _volumeField.setText(""+level);    }
    
        //increase the Player volume by 10    private void volumeUp()     {        _currentVolume += 10;        //Set _currentVolume to a valid value if it's out of range        if (_currentVolume > 100)         {            _currentVolume = 100;        }        //Set Player volume to _currentVolume        setVolume(_currentVolume);    }
    
        //decrease the Player volume by 10    private void volumeDown()    {        _currentVolume -= 10;        //Set _currentVolume to a valid value if it's out of range         if (_currentVolume < 0)         {            _currentVolume = 0;        }        //Set Player volume to _currentVolume        setVolume(_currentVolume);    }
    
        //create a menu item for switching Player to full screen mode    private MenuItem _fullScreen = new MenuItem("Full Screen",200000,10)     {        public void run()         {            //try block            try             {                //switch Player to full screen mode                _videoControl.setDisplayFullScreen(true);            }             //catch MediaException            catch (MediaException e)             {                e.printStackTrace();            }        }                   };
    
        //create a menu item for users to pause and resume playback     private MenuItem _pauseItem = new MenuItem("Pause/Resume", 200000, 10)     {        public void run()        {                  //Start or stop the Player based on the Player state            //try block            try             {                //if current Player state is STARTED stop the Player                if (_player.getState() == Player.STARTED)                 {                    _player.stop();                }                 //else if current Player state is PREFETCHED start the Player                else if (_player.getState() == Player.PREFETCHED)                {                    _player.start();                }             }            //catch MediaException            catch (MediaException e)             {                e.printStackTrace();            }        }    };
    
        //create a menu item for users to close the application    private MenuItem _closeItem = new MenuItem("Close", 200000, 10)     {        public void run()        {            onClose();        }    };
    
        //override makeMenu to add the new menu items    protected void makeMenu( Menu menu, int instance )    {        menu.add(_pauseItem);        menu.add(_fullScreen);        menu.add(_closeItem);    }
    
        //override keyControl to handle volume up and down key presses    protected boolean keyControl(char c, int status,int time)     {       //Handle volume up and down key presses to adjust Player volume       //if volume up is pressed call volumeUp()         if (c == Characters.CONTROL_VOLUME_UP)         {            volumeUp();            return true;        }        //else if volume down key is pressed call volumeDown()         else if (c == Characters.CONTROL_VOLUME_DOWN)         {            volumeDown();            return true;        }         //else call the default keyControl handler of the super class        else         {            return super.keyControl(c, status, time);        }    }
    
        //catch Player events and display them in the _eventField    public void playerUpdate(Player player, String event, Object eventData)    {        //Update _eventField with the current event        _eventField.setText(event);    }}
    
    //Manager to lay out the Player _videoField on the VideoScreenfinal class VideoManager extends net.rim.device.api.ui.Manager {    public VideoManager()     {        super(0);    }
    
        //lay out the _videoField on the screen based on it's preferred width and height    protected void sublayout(int width, int height)     {        if (getFieldCount() > 0)         {            Field videoField = getField(0);            layoutChild(videoField, videoField.getPreferredWidth(), videoField.getPreferredHeight());        }        setExtent(width, height);    }}
    

    .. Mm2/src/com/rim/samples/multimediademo/MultimediaDemo.Java

    .. Mm2/src/com/rim/samples/multimediademo/sample.MP4

    The above structure seems good. Just to confirm, did you add sample.mp4 to your project?

  • EditField: protected boolean insert (...) not called if the device uses VirtualKeyboard

    Hi all

    I extend the EditField class to intercept the entries of tank / backspaces and do something. I would outweigh all the methods of the superclass:

    protected boolean insert(char arg0, int arg1);
    public int insert(String text);
    protected int insert(String text, int context);
    
    protected boolean backspace();
    protected int backspace(int count, int context);
    public int backspace(int count);
    

    I tried on a 8520 (which has a physical keyboard) and the methods overridden were correctly when you type something in the field. However, this is not the case on a touch device (tried on a 9380). In this case the text is typed and showed correctly in the EditField custom, but not the method above is called never. I am quite confused...

    Is anyone of you know how to insert text in the virtual keyboard in the EditField? Is it possible to intercept these events?

    See you soon,.

    Beto

    The problem with keyChar and keyDown is that the char to insert depends on the keyboard layout, I didn't want to do something that it is already done by RIM.

    However, I have tried those overring however, but keyChar is never invoked, and keyDown gave place to a chariot double inserted in the editfield...

    In the end, I followed a suggestion made by @peter_strange in another post (I'll add the link if I managed to find it again) and put a FieldChangeListener on the edit field. When field changes, if the context is 0 (user action), I check if the text is changed and do what I have to do...

    Thank you.

    Beto

  • How to manage touch event in the field

    Hello

    I created field checkbox custom, when am touch event for her manipulation, emphasis is gettting inside, and when I try to click on any other components such as the box native, afer by unchecking the custom check box, the custom box is clicking again.

    How to handle this?

    Thank you

    Rakesh Shankar

    There are certain basics that one needs to understand to effectively manage key events:

    (1) touch events are sent to the field currently has focus and the enveloping managers, including the active screen.

    (2) default response of the system to the event down is to divert attention to the field to the position of touch If there is a focusable it. If there is no focusable point touch field, the field currently has focus is unchanged. There's no "unfocus everything ' method in BlackBerry (there might be, but it is not readily available - there is a protected method focusRemove, but it is supposed to be used in conjunction with a later focusAdd protected in cases where the field has changed its focus rectangle - a classic example is any input field or text such as EditField or RichTextField view)

    (3) the default action of TouchEvent.CLICK is to call trackwheelClick (which, by default, invokes navigationClick) which is a great way to ensure consistency between the 'clicks' and clicks touchpad screen. The same is true for unclicks finally managed by navigationUnclick.

    If you want to disable the click by default if the key is outside all focusable fields and will not disrupt the rest of the system, just return true if the event is to CLICK, but the contact details are outside the scopeand actions super.touchEvent otherwise. And keep your return true; on all UNCLICK events: it's a good idea if you don't want to see the context menu from appearing each time or field click reaction called twice.

    The example of Peter was written when I've heard most of it already, but now I realize that you can do a lot easier. See part highlighted the previos section.

    Good luck!

  • [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.

  • Cannot remove the tank on once implemented editField keyChar

    In simple codes below, there is an editField in the screen. For Storm OS 4.7, once I entered a word in the edit field, I can't use the BACKSPACE key to delete any letter. The only way is to add a letter so that all letters are highlighted. Then only the BACKSPACE key will seek to remove the letters.

    If I set the keyChar method comment, I can add/remove letters freely.

    Did I miss something in the keyChar implementation and this removal of cuased letter is not not possible?

    Thank you

    class HomeScreen extends UiApplication {
    
        public static void main(String[] args)
        {
            HomeScreen app = new HomeScreen();
            app.enterEventDispatcher();
        }
    
        HomeScreen() {
            pushScreen(new EditScreen());
        }
    
        private class EditScreen extends MainScreen {
    
            EditScreen(){
                add(new EditField(EditField.EDITABLE));
            }
    
            protected boolean keyChar(char key, int status,  int time){
                boolean result = false;
                if (key == Characters.ESCAPE){
                    Dialog.alert("Escape key is pressed");
                    result = true;
                }
    
                return result;
            }
        }
    }
    
    protected boolean keyChar(char key, int status,  int time){    if (key == Characters.ESCAPE){          Dialog.alert("Escape key is pressed");
    
            // consuming event if escape pressed         return true;       } else {         // for non-escape keys passing call to the parent          return super.keyChar(key, status, time);                        }}
    
  • How to convert the Editfield value chain

    Greetings

    Please help me to convert the editfield in sting.

    with the help of toString (), it does not convert it to a string.

    Help, please

    concerning

    Anthony singh

    arkadyz is located...

    but you must put this line in an event thread... because you enter the value in an editfield dynamically (at runtime) he must go and look after that the value has been added...

    As you can use a button... When you click on it, then the value is extracted from the help:

    final String text = SmsField.getText ();

    and your dialog box appears...

  • Bimap field + EditField click problem

    Hello

    In my application, I am increasing and decreasing value in an editfield using two buttonfields, everything works fine, but if I click on the changed value in the editifeld picture but menu "Application report" come again by pressing ESC and then only I am able to click on the image.

    Even if I click editfield also 'switch' application menu pop up appears please check the picture of the call and inform me how to limit this menu in the click bimap and editfield

    Note: earlier in the popup 'application Switch, close' options appear in the context menu, but after using the below only switch application code comes

    protected void makeMenu (menu Menu, for example int)
    {
    menu.deleteAll ();
    }

    If you return false, you indicate that you have not consumed the event (and a few other layer will be, so the menu).
    return true instead.

  • iLLEGALARGUMENT EXception on touch event

    package mypackage;
    
    import java.util.Vector;
    
    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FocusChangeListener;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.Manager;
    import net.rim.device.api.ui.TouchEvent;
    import net.rim.device.api.ui.TouchGesture;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.XYRect;
    import net.rim.device.api.ui.component.BasicEditField;
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.component.SeparatorField;
    import net.rim.device.api.ui.component.Status;
    import net.rim.device.api.ui.container.HorizontalFieldManager;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    
    public class PlaylistTab extends MainScreen  implements FocusChangeListener{
    
        private int _xCoord = 0; //The x coordinate for the top left corner of the image.
        private int _yCoord = 0; //The y coordinate for the top left corner of the image.
        private int _xTouch = 0; //The x coordinate of the previous touch point.
        private int _yTouch = 0; //The y coordinate of the previous touch point.
    
        private LabelField tab1;
    
        private LabelField tab2;
    
        private LabelField tab3;
    
        private LabelField spacer1;
    
        private LabelField spacer2;
    
        private VerticalFieldManager tabArea;
    
        private LabelField tab1Heading;
    
        private BasicEditField tab1Field1;
    
        private BasicEditField tab1Field2;
    
        private LabelField tab2Heading;
    
        private BasicEditField tab2Field1;
    
        private BasicEditField tab2Field2;
    
        private LabelField tab3Heading;
    
        private BasicEditField tab3Field1;
    
        private BasicEditField tab3Field2;
    
        private VerticalFieldManager tab1Manager;
        private VerticalFieldManager tab2Manager;
        private VerticalFieldManager tab3Manager;
        int tabNum = 1;
        public PlaylistTab()
        {
            super(NO_VERTICAL_SCROLL | NO_VERTICAL_SCROLLBAR);
            //HorizontalFieldManager hManager = new HorizontalFieldManager();
            HorizontalFieldManager hManager = new HorizontalFieldManager(NO_VERTICAL_SCROLL | NO_VERTICAL_SCROLLBAR | NO_HORIZONTAL_SCROLL  | NO_HORIZONTAL_SCROLLBAR);
            Font font = getFont().derive(Font.PLAIN, 35);
            tab1 = new LabelField("Songs", LabelField.FOCUSABLE | LabelField.HIGHLIGHT_SELECT)
            {
                protected boolean navigationClick(int status,int time){
    
                    return true;
                }
                protected void layout(int width, int height) {
                    super.layout(width, height);
                    //    this.setExtent(this.getWidth(), 60);
                    this.setMargin( ( getHeight() - this.getPreferredHeight()), 0, 0, (getWidth() - this.getPreferredWidth()));
                }
            };
            tab2 = new LabelField("Album", LabelField.FOCUSABLE | LabelField.HIGHLIGHT_SELECT)
            {
                protected boolean navigationClick(int status,int time){
    
                    return true;
                }
                protected void layout(int width, int height) {
                    super.layout(width, height);
                    //    this.setExtent(this.getWidth(), 60);
                    this.setMargin( ( getHeight() - this.getPreferredHeight()), 0, 0, (getWidth() - this.getPreferredWidth()));
                }
            };
            tab3 = new LabelField("Artist", LabelField.FOCUSABLE | LabelField.HIGHLIGHT_SELECT)
            {
                protected boolean navigationClick(int status,int time){
    
                    return true;
                }
                protected void layout(int width, int height) {
                    super.layout(width, height);
                    //    this.setExtent(this.getWidth(), 60);
                    this.setMargin( ( getHeight() - this.getPreferredHeight()), 0, 0, (getWidth() - this.getPreferredWidth()));
                }
            };
            spacer1 = new LabelField(" | ", LabelField.NON_FOCUSABLE);
            spacer2 = new LabelField(" | ", LabelField.NON_FOCUSABLE);
    
            tab1.setFocusListener(this);
            tab2.setFocusListener(this);
            tab3.setFocusListener(this);
            hManager.add(tab3);
            hManager.add(spacer1);
            hManager.add(tab2);
            hManager.add(spacer2);
            hManager.add(tab1);
    
            add(hManager);
            add(new SeparatorField());
    
            tab1Manager = new VerticalFieldManager(VERTICAL_SCROLL | VERTICAL_SCROLLBAR );
            tab2Manager = new VerticalFieldManager(VERTICAL_SCROLL | VERTICAL_SCROLLBAR );
            tab3Manager = new VerticalFieldManager(VERTICAL_SCROLL | VERTICAL_SCROLLBAR );
    
            tabArea = displayTab3();
            add(tabArea);
    
        }
        public void focusChanged(Field field, int eventType) {
            if (tabArea != null) {
                if (eventType == FOCUS_GAINED) {
                    if (field == tab1) {
                        System.out.println("Switch to Tab 1");
                        delete(tabArea);
                        tabArea = displayTab1();
                        add(tabArea);
                    } else if (field == tab2) {
                        System.out.println("Switch to Tab 2");
                        System.out.println("Switch to Tab 1");
                        delete(tabArea);
                        tabArea = displayTab2();
                        add(tabArea);
                    } else if (field == tab3) {
                        System.out.println("Switch to Tab 3");
                        System.out.println("Switch to Tab 1");
                        delete(tabArea);
                        tabArea = displayTab3();
                        add(tabArea);
                    }
                }
            }
    
        }
    
        public VerticalFieldManager displayTab1() {
            try
            {
                tabNum = 3;
                final VerticalFieldManager Content= new VerticalFieldManager(Manager.USE_ALL_WIDTH|Manager.VERTICAL_SCROLL);
                Content.setMargin(5,0,0,0);
                int mas  = 0 ;
                Vector oleg = new Vector();
                SQLManager poligs = new SQLManager();
                poligs.getSongDownload(oleg, 0);
                while(mas < oleg.size())
                {
                    Song temp = (Song) oleg.elementAt(mas);
                    Content.add(new A_Song(temp.songId, temp.songName, false,temp.albumCover,temp));
                    mas++;
                }
                tab1Manager.deleteAll();
    
                HorizontalFieldManager topManager = new HorizontalFieldManager()
                {
                    public void paint(Graphics graphics)
                    {
                        graphics.setBackgroundColor(0x00000000);
                        graphics.clear(); super.paint(graphics);
                    }
                    protected void sublayout( int maxWidth, int maxHeight )
                    {
                        int width = Display.getWidth();
                        int height = this.getPreferredHeight();
                        super.sublayout( width, height);
                        setExtent( width, height);
                    }
                };
                CustomTextBox editField = new CustomTextBox();
                int pol = Display.getWidth() / 2;
                editField.setWidth(pol);
                ButtonField button = new ButtonField("Search");
                topManager.add(editField);
                topManager.add(button);
    
                //  tab1Manager.add(topManager);
                tab1Manager.add(Content);
            }
            catch(final Exception e)
            {
    
                e.printStackTrace();
                System.out.println("------------------- ");
            }
            return tab1Manager;
        }
    
        public VerticalFieldManager displayTab2() {
            try
            {
                tabNum = 2;
                final VerticalFieldManager Content= new VerticalFieldManager(Manager.USE_ALL_WIDTH|Manager.VERTICAL_SCROLL);
                Content.setMargin(5,0,0,0);
                int mas  = 0 ;
                Vector oleg = new Vector();
                SQLManager poligs = new SQLManager();
                poligs.getSongDownloads(oleg, 0);
                while(mas < oleg.size())
                {
                    Albums temp = (Albums) oleg.elementAt(mas);
                    Content.add(new A_Album(temp.albumId, temp.albumName, false,temp.albumCover,temp));
                    mas++;
                }
                tab2Manager.deleteAll();
                tab2Manager.add(Content);
            }
            catch(final Exception e)
            {
    
                e.printStackTrace();
                System.out.println("------------------- ");
            }
            return tab2Manager;
        }
    
        public VerticalFieldManager displayTab3() {
            try
            {
                tabNum = 1;
                final VerticalFieldManager Content= new VerticalFieldManager(Manager.USE_ALL_WIDTH|Manager.VERTICAL_SCROLL);
                Content.setMargin(5,0,0,0);
                int mas  = 0 ;
                Vector oleg = new Vector();
                SQLManager poligs = new SQLManager();
                poligs.getSongDownloadss(oleg, 0);
                while(mas < oleg.size())
                {
                    Artist temp = (Artist) oleg.elementAt(mas);
                    //Content.add(new A_AddSingersFM(temp.songId, temp.songName, false,temp.albumCover,temp,-1, tb, logIn,logOut,1,0,0, Register));
                    Content.add(new A_Artisti(temp.artistId, temp.artistName, false,temp.artistPhoto,temp));
                    //  int m = temp.getSongId();
                    mas++;
                }
                tab3Manager.deleteAll();
                tab3Manager.add(Content);
            }
            catch(final Exception e)
            {
    
                e.printStackTrace();
                System.out.println("------------------- ");
            }
            return tab3Manager;
        }
        protected boolean touchEvent(TouchEvent touchEvent)
        {
            int eventCode = touchEvent.getEvent();
    
            if(eventCode == TouchEvent.GESTURE){
                System.out.println("SWIPE GESTURE");
                TouchGesture g = touchEvent.getGesture();
                int gesturecode = g.getEvent();
                int direction = g.getSwipeDirection();
    
                //gallery.setHorizontalScroll(page_two, true);
                if(direction == TouchGesture.SWIPE_WEST)
                {
    
                    if(tabNum == 3)
                    {
                        delete(tabArea);
                        tabArea = displayTab2();
                        add(tabArea);
                    }
                    else if(tabNum == 2)
                    {
                        delete(tabArea);
                        tabArea = displayTab3();
                        add(tabArea);
                    }
                }
    
                if(direction == TouchGesture.SWIPE_EAST)
                {
    
                    if(tabNum == 1)
                    {
                        try
                        {
                            delete(tabArea);
                        }
                        catch(Exception e)
                        {
                            try
                            {
                                tabArea = displayTab2();
                            }
                            catch(Exception ef)
                            {
                                add(tabArea);
                                return false;
                            }
                            add(tabArea);
                            return false;
                        }
                        try
                        {
                            tabArea = displayTab2();
                        }
                        catch(Exception ef)
                        {
                            add(tabArea);
                            return false;
                        }
                        add(tabArea);
                        return false;
    
                    }
                    else if(tabNum == 2)
                    {
                        try
                        {
                            delete(tabArea);
                        }
                        catch(Exception e)
                        {
                            try
                            {
                                tabArea = displayTab1();
                            }
                            catch(Exception ef)
                            {
                                add(tabArea);
                                return false;
                            }
                            add(tabArea);
                            return false;
                        }
                        try
                        {
                            tabArea = displayTab1();
                        }
                        catch(Exception ef)
                        {
                            add(tabArea);
                            return false;
                        }
                        add(tabArea);
                        return false;
                    }
                }
            }
            //The touch event was not consumed.
            return false;
        }
    }
    

    On the sidelines, East or West navigation events I illegalargument exception.and my page crashing.

    However, when I run the same code through the debugger it works fine. I put my debugging inside the touchevent ifs and elses togglepoints.

    And note, if it crashes and I click on an illegal argument exception... I go back to the home page and as if the touchevent function was called twice and 2 strips was skipped.

    It works fine but through debugger.any help?

    very strange, I did this and it worked

    protected boolean touchEvent(TouchEvent message)
        {
            try
            {
                int eventCode = message.getEvent();
    
                if(eventCode == TouchEvent.GESTURE){
                    System.out.println("SWIPE GESTURE");
                    TouchGesture g = message.getGesture();
                    int gesturecode = g.getEvent();
    
                    switch(gesturecode) {
    
                        case TouchGesture.SWIPE:
                            int direction = g.getSwipeDirection();
                        //gallery.setHorizontalScroll(page_two, true);
                        if(direction == TouchGesture.SWIPE_WEST)
                        {
    
                            if(tabNum == 3)
                            {
                            //  delete(tabArea);
                            //  tabArea = displayTab2();
                            //  add(tabArea);
                                tab2.setFocus();
                                return super.touchEvent(message);
                            }
                            else if(tabNum == 2)
                            {
                            //  delete(tabArea);
                            //  tabArea = displayTab3();
                            //  add(tabArea);
                                tab3.setFocus();
                                return super.touchEvent(message);
                            }
                        }
                        else if(direction == TouchGesture.SWIPE_EAST)
                        {
    
                            if(tabNum == 1)
                            {
    
                                        //delete(tabArea);
                                        //tabArea = displayTab2();
                                        //add(tabArea);
                                        tab2.setFocus();
                                        return super.touchEvent(message);
    
                            }
                            else if(tabNum == 2)
                            {
    
                                    //delete(tabArea);
                                    //tabArea = displayTab1();
                                    //add(tabArea);
                                    tab1.setFocus();
                                    return super.touchEvent(message);
    
                            } }
    
                        break;
                    }
                }
                    //The touch event was not consumed.
                    return super.touchEvent(message);
            }
            catch(Exception eol)
            {
                return super.touchEvent(message);
            }
        }
    

    I do this on tab2.setfocus (), if I call setfocus it works... but if icall it separately as it is not and it hangs. very strange

    // delete(tabArea);
                            //  tabArea = displayTab2();
                            //  add(tabArea);
    
    
    
  • Nature of the touch events

    Hello ladies and gentlemen,

    I am currently working on activating the touch support to an existing application to my friends, and I'm running into some difficulties. My screen consists of a few: on the bottom, I have a row of BitmapFields acting as buttons all content in a HFM, above that I have a great EditField, and above I have a HFM with a few more selectable BitmapFields.

    First of all, I'm not sure that should be implemented in touchEvent(), my managers or the fields themselves. I tried both, but noticed a strange behavior. It seems that the field that currently has the focus Gets the touchEvent little anywhere on the screen, the key event occurs.

    I think that the OS would simply understand that touching an object simply focusable means 'set the focus to this item"and clicking on the object means 'click on this object', I don't think you should even implement the touchEvent() method to achieve this effect.

    Does anyone have experience of writing applications for the storm? Am I missing something?

    Thank you
    Tyler

    Thank you Rex,

    I did a search on "touchEvent" but did not find much.

    Oops, looks like I just got this job.

    Let me explain what I have in case someone else comes on this thread:
    -My screen has a 'top manager' who handles most of the items on the screen, including other managers

    -J' have a HFM at the bottom of the screen (which is managed by my Senior Manager) that contains several BitmapFields that act like buttons
    -The question I had was trying to setFocus in the appropriate field when this field was hit

    Here's what I added to my managers to manage events:

    protected boolean touchEvent(TouchEvent event)    {        //Figure out where the touch occurred on the screen        int globX = event.getGlobalX(1);        int globY = event.getGlobalY(1);
    
            //Determine if the touch occurred within the extent of this manager        if (getExtent().contains(globX, globY))        {            if (event.getEvent() == TouchEvent.DOWN)            {                //Get the position of the touch within the manager                int x = event.getX(1);                int y = event.getY(1);
    
                    //See if there is a field at this screen position                int fieldIndex = getFieldAtLocation(x, y);
    
                    if ((fieldIndex >= 0) && (fieldIndex < getFieldCount()))                {                    //Set the focus to the field at this position                    Field f = getField(fieldIndex);                    f.setFocus();                }
    
                    //Return false so that the event propagates to the contained field                return false;            }        }
    
            //Event wasn't for us, handle in default manner        return super.touchEvent(event);    }
    

    In addition, you must ensure you set the scope of your managers correctly, both real as virtual, I usually do when I'm in the override of the sublayout() method.

    Hope this helps people.

  • How to invite people to an event calendar with the new iOS 10?

    Before I updated to iOS of 10, I was able to create a calendar event with the apple iPhone built-in calendar and there is an option to 'invite' contacts him so they could add to their calendar. I can't find this option now after the new update. Where and how can I do this?

    Invite others to an event. You can invite people to an event, even if you're not the one who, on demand with Exchange and some other servers. Press an event, press on modify, then on the guests. Type the names, or tap to select the people to contact. If you don't want to be notified when someone refuses a meeting, go to settings > calendar, then disable view guest declines.

  • the iOS 10 not displaying calendar widget is not the events

    After the update to iOS 10.0.2, the calendar available on the lock screen widget does not always display the events. Nor the duration of the event or the event name appears, but a white widget with calendar color bar can be seen.

    This is not always the case, but very often. For ex, if you open the calendar application, then check this widget, event, but after that you lock the screen and check again, it would disappear.

    Hello jyothishureth,

    Thank you for using communities of Apple Support. It is my understanding from your iPhone Calendar widget still shows no events. I use my daily calendar to keep me organized. I can understand your concern. I'm happy to help you.

    If you haven't done so already, I recommend that you restart the phone. This can solve many unexpected behaviours. Follow the steps below:

    1. Press and hold the sleep/wake button until the Red slider appears.
    2. Drag the slider to turn off your device completely off.
    3. Once the device turns off, press and hold the sleep/wake button again until you see the Apple logo

    Restart your iPhone, iPad or iPod touch

    If the problem persists, try to remove the widget and adding it back on. Use the following steps:

    1. Right above the home, lock screen or Notification Centerscreen.
    2. Scroll down and tap on change.
    3. To add a Widget, press on . To remove a Widget, press on . To reorder your Widgets, touch and hold next to the apps and drag the in the desired order.
    4. Finally, tap done.

    Use Widgets on your iPhone, iPad and iPod touch

    Have a great day!

  • not all the events of the day on the notification screen

    Hello

    I can't get all the events of the day in the calendar widget on the screen of the notification of my iPad. Genius Bar and Apple Support are unable to solve. Can anyone help?

    Thank you

    for this I think should download sparse, ultra calendar application very simple, advanced and simplified

  • Events calendar on Mac sync iPhone or Apple Watch

    Input events calendar I have on my Mac don't sync my iPhone or Apple Watch.  Events calendar on iPhone synch to iMac.  in iCloud preference, I've marked contacts, calendars and notes.  All the work schedules.  Any suggestions?

    Option 1) update your calendars and reminders of the app of calendars:

    Open the calendar application.

    Choose View > refresh calendars.

    Try option 2) remove the account in calendar > Preferences > accounts.

    Now add back.

    Option 3) if it still fails to work, try to test in the comments or new user.

    CREATE A NEW USER

    Go to system-> Preferences, create a new user in users and groups.

    Switch to the new user by logging incoming/outgoing or use the fast user switching.

    Connection with Apple ID

    Only select Calendar for this test.

    Open calendar and test by adding an event and see if it syncs with the iPhone.

    You still see the issue?

    If so, see these steps by khati for Installation of Sierra difficulty. I suggest you reinstall Sierra again.

    If not, then the problem is in your user folder.

    Journal of the user and then Log in your user folder.

    With Calendar.app quit...

    Go to the library to the user (see below)

    Scroll to the bottom for calendars

    Place these files in the Recycle Bin

    • Calendars/calendar Cache
    • Calendars/calendar Cache-shm
    • Calendars/calendar Cache-shm

    Also in the user's library, scroll to containers. Move these to the desktop.

    • Containers/com.apple.CalendarAgent
    • Containers/com.apple.iCal

    Scroll down to preferences. Move these to the desktop.

    • Preferences/com.apple.CalendarAgent.plist
    • Preferences/com.apple.iCal.plist

    Sign out under the Apple in the menu bar.

    Open a session

    Open Calendar.app

    It's working now?

    Library of the user to see the

    The user library folder is hidden by default. In the unhide: select the Finder in the Dock. Less go in the Menu bar > hold down the Option key and you will see the library.

    Find the library user folder

    http://www.takecontrolbooks.com/resources/0167/site/chap11.html#FindingtheUserLi braryFolder

  • Import emails .ics calendar events

    I recently updated my 5 c to 10 IOS iPhone and I can't import all events in a calendar .ics file into the standard calendar from an email app.

    Previously in older IOS, the method was:

    1. open email with the .ics file.

    2. tap on the file in .ics to display a list of events.

    3. scroll to the bottom of events and press 'Add all' and then select the calendar to which events are to be added.

    Nothing is more a ' add all ' button. I tried to add events one at a time, but appears not to half of the working time.

    I met the same problem.  I tested this by creating a file ICS w / calendar (version 8) on my Mac OS X (el capitan 10.11.6) then sent me.

    Using the default e-mail program, I can see the file but cannot add them both.  Is there another way, we are supposed to do now?

Maybe you are looking for