How to move the cursor in JTable?

I want to move the cursor focus a cell of JTable,
but I don't know which method should be used?
can you help me, pls
thanks!

Could you be more clear in ur question as to what do u exactly want ? if you just wanna selecte a particualr row in that case you just call the method setRowSelectionInterval
Hoep it helps
vikram

Similar Messages

  • How to move the cursor in a text input programatically

    Hi,
    I am using a TextInput field and a my own keyboard UI with buttons for each alphabet.
    When the user presses buttons on the keyboard UI, i populate the TextInput field through data binding.
    But I would want the cursor to move as the characters are entered in the field at the same time.
    So, how do I move the cursor using actionscript code?
    thanks,
    Sunil

    In that case you need to programmatically insert the text at the selection point. You get the selection point using the selectionBeginIndex and selectionEndIndex properties. I have an app where I do that, using this code:
    // textInput is the name of the TextInput control
    private function insertTextAtSelection(text:String):void
         var start:int = textInput.selectionBeginIndex;
         var end:int = textInput.selectionEndIndex;
         var hasSelection:Boolean = start != end;
          textInput.text = textInput.text.substring(0, start) + text + textInput.text.substring(end);
         if (hasSelection)
             textInput.selectionBeginIndex = start;
             textInput.selectionEndIndex = start + text.length;
         else
             textInput.selectionBeginIndex = textInput.selectionEndIndex = end + text.length;
    This is what the code does:
    gets the starting and ending positions of the insertion point (in case the user has an active selection rather than just an insertion point).
    concatenates the old text with the new text and writes it into the text input
    restores the user's previous selection or insertion point (In this case I'm setting the selectionBeginIndex and selectionEndIndex properties rather than calling setSelection(), but the end result is the same.)

  • How to move the cursor to a text field

    Hello,
    I have a log in window with Username (Text field) and password (Secure Text field). The 'Log In' button is not enabled if I use the Set command. So I wish to use the Keystroke.
    But I need to make sure that Cursor is in the text field and then to keystroke. So how can I move the cursor to the required text filed?
    Note:
    +Why the cursor is not blinking in the text field where I just 'SET' (command)+
    +the value?+

    Well, for a start you can identify the application you're working in. That's kind of important.
    In most cases you can just emulate a press of the tab key but it's kind of a crude a approach (there's no guarantee that you're in the field you expect). Certain applications, though, may have better ways of achieving it, but since we don't know what application you're using we can't say if that's the case here.

  • How to move the cursor with keyboard

    Is there a way to move the cursor with the keyboard? My right forearm is hurting prob because of extended use of the mouse.

    While in the 'Finder' click on 'Help' in the upper menu bar....enter 'Mouse Keys' and then select 'Controlling the pointer with the numeric keypad'....only problem I can see is the MacBook doesn't have a numeric keypad...so you would need an full size external keyboard....tried it on my iMac and it works OK...

  • How to move the cursor dynamically

    Hi friends,
             I want to move the cursor  in the output list.  According to the cursor movment I want the output order.
             Normally cursor will move   -
    when first line completes  then only it will go to next line. after that same process but for  me  I want to move  the cursor position from 40 th line to 2nd line or anywhere. Please explain me.
    Regards,
    Surya

    Hi,
         Thank u,
         SET cursor is used to put the cursor on the selection screen. but what my requirement is I want to display the all contents of internal table into he colum wise.
    normally we will print like this   f1  f2  f3 ....one row shows one record.
    but for me output is.
                                   f1
                                   f2
                                   f3
                                      .  one colum will show one record.
    Regards,
    Surya

  • How to programmatically move the cursor to the "To" field of a new AppointmentItem?

    I need to move the cursor to the "To" field of all new AppointmentItems which are created through my Outlook Addin. How I can achieve this?
    Thanks in advance.
    Thanks Prasad

    Hello Prasad,
    The Outlook object model doesn't provide anything for that. You need to use Windows API functions or use
    Accessibility API to set the cursor programmatically.

  • Safari status bar disappears.  I have tried clicking on show status bar and it will only appear when I move the cursor to the top of the screen.  I can not minimize the open page only full screen or close the browser.  Any idea how the rectify this

    Safari status bar disappears. I have tried clicking on show status bar, under the View tab and it will only appear when I move the cursor to the top of the screen. I can not minimize the open page, only full screen or close the browser. Any idea how the rectify this issue?

    One enters and exits full-screen with control+command+F keys. This is on the View menu in Safari. Optionally, the green traffic light in your browser title bar, if you roll over it, has the full-screen control it it. While in full-screen mode with Safari, moving your mouse pointer virtually up, and off-screen reveals the Safari title bar again, and you can click the green traffic light to exit full-screen mode.
    You can hide/show the status bar by simply typing command+/. This too, is on the Safari View menu. and in 10.10.1 — it works reliably for me.

  • HT1338 Hi , at Launchpad when I move the cursor up the screen starts to thimble. Any idea how to fix it. thanks Jacob

    Hi , at Launchpad when I move the cursor up the screen starts to thimble. Any idea how to fix it. thanks Jacob

    HI Jacob, Did you ever solve your problem with Launchpad? I am having the same problem now.

  • At Launchpad when I move the cursor up the screen starts to tremble. any idea how to fix it ?  Jacob

    at Launchpad when I move the cursor up the screen starts to tremble. any idea how to fix it ? Jacob

    HI Jacob, Did you ever solve your problem with Launchpad? I am having the same problem now.

  • HT2477 when i move the cursor across the screen it launches the dashboard - how do i stop it

    when i move the cursor across the screen to the left it launches the dashboard - how do i stop it doing that ?

    Hi Jimb9,
    Thanks for visiting Apple Support Communities.
    If Dashboard seems to be launching automatically when you move your mouse to the left, first check to see if a "Hot Corner" has been set.
    Hot Corners
    To specify an action to perform when you move the pointer to a screen corner, choose the action from one of the Active Screen Corners pop-up menus.
    After you set an active corner, move your mouse to that corner of your screen to see the result.
    You can find the Active Screen Corners menu by going to System Preferences, then choosing Mission Control and clicking the Hot Corners button in the bottom left.
    These articles have more information about Mission Control:
    Mac Basics: Mission Control
    http://support.apple.com/kb/ht4689
    OS X Mavericks: Mission Control preferences
    http://support.apple.com/kb/PH13925
    All the best,
    Jeremy

  • My webpages wont refresh unless i move the cursor, how do i fix this?

    my webpages wont refresh unless i move the cursor.
    some post on here told me to disable acceleration, which i did.
    this worked for a while but now the problem is back.
    how do i fix this?

    I think you are in "full screen" mode. Use the F11 key to switch between full screen and normal modes. Does that solve the mystery?

  • How to prevent middle mouse click to move the cursor but still poaste the clipboard ?

    This is a linux only issue.
    When i'm typing a text editing box, i use the select text/middle click gesture to copy/paste text.
    But the middle click not only paste the selected text but move the cursor at the actual mouse position before.
    I don't want this behavior, because :
    1. I work a lot with vim, where you don't mouve the cursor using the mouse, so i must change my habit when i'm using firefox.
    2. When i middle click, event if i put the mouse in the right place, i might mouve it a bit and the text will be pasted on the wrong place
    I've been looking in the about:config and the only related option is
    middlemouse.paste;
    If i put it to false, the middle click button does not mouve the cursor, nor does it paste.
    Any idea how to achieve that ?

    I do not find the cursor moving on me if I use middle-click to paste text or url that is in that I highlighted into clipboard. Whether I used my Logitech MX510 or the T-CH!!/T-CL13 trackballs that I use now.
    The right-click and copy selection then right-click and paste to paste contents where Caret is method can be more precise though.
    '''FredMcD''', if you have not used Linux then maybe you should not be replying to questions that are Linux specific. Same with Mac OSX.

  • In latest Nightly, arrow keys don't move the cursor but instead exit the text box. How can I fix this so that the arrow keys move the cursor?

    Using Nightly 28.0a1, I'm having a problem with the text box fields when typing. I use Hacker's Keyboard which has onscreen arrow keys and I find it more convenient than fiddling with a tiny cursor thumb when editing text. On the Play Store Firefox it works just fine but on Nightly, any time I try to move the cursor with the arrow keys it jumps out of the text box and highlights other elements on the page. This is annoying beyond belief as it means having to resort to that imprecise thumb cursor that takes forever to get where you want it. Is this a known issue with the latest nightly builds?

    Thanks for the report. I have filed bug https://bugzilla.mozilla.org/show_bug.cgi?id=939959. It would be helpful to know and if you can comment into the bug to indicate which input field you are testing on.

  • How can I move the cursor in the ResultSet?

    Hi all,
    The following is part of my coding...
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    // TODO add your handling code here:
             ResultSet codes = getCodes();
            try
                    codes.first();          
                    Code c = getCode (codes);
                    jLabel8.setText(c.scode);
                    jTextField2.setText(c.name);
                    jLabel9.setText(c.ic);
                    jTextField4.setText(c.add);
                    jTextField5.setText(c.phone);
            catch (SQLException e)
                System.out.println(e.getMessage());
        private static ResultSet getCodes()
            Connection con = getConnection();
            try
            Statement s = con.createStatement();
            String select = "SELECT [Student-File].* " + "FROM [Student-File];" ;
            ResultSet rows;
            rows = s.executeQuery(select);
            return rows;
            catch (SQLException e)
                System.out.println(e.getMessage());
            return null;
        } I would like to moves the cursor to the first row in the ResultSet object...
    But an error occured...
    Result set type is TYPE_FORWARD_ONLY
    I have tried to change
    Statement s = con.createStatement();to
    Statement s = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE);But a warning existed...
    cannot find symbol
    symbol : method createStatement(int)
    location : interface java.sql.Connection
    Can anyone help me?Thanks.
    Ning.

    Hi,
    Actually I would like to create 2 button, one is named as NEXT, another one is named as PREVIOUS. Once i click on the NEXT or PREVIOUS button, a query statement will be executed to retrieve the information of all of the student in a table. At the same time, the name, student code, address, ic and phone number of a student will be displayed by label respectively. After that, if I click on the NEXT button, the information of the current student will be replaced by the information of the next student. By the way, if I click on the PREVIOUS button, the information of the current student will be replaced by the information of the previous student.
    Ning.

  • How can I disable the menu bar to pop up when I move the cursor to the top of the screen?

    Greetings, guys!
    I'm completely new to Os X.
    I want to know if the menu bar can be disabled not to appear when moving to the screen top.
    It unnecessarily appears when I play a shooting game like Contract Killer in Full-screen Mode, in which I occasionally happen to move the cursor to the top.
    Thank you...

    There are 2 Fullscreen modes for some games. And some games only use 1 of them. The usual Fullscreen that you'd expect, and the one we call "Borderless Window".
    The classic Fullscreen utilizes all your display and things like menu bar, OSD's, "Always On Top" windows won't pop up while you are playing. But the Borderless Window is just a window that has the same resolution and dimensions with your desktop, and has no borders. Other elements like menu bars, OSD's and "Always stay on top" windows can get into your way while playing. And it's also slower than the classic fullscreen.
    Check if your game offers any option of selecting between these 2 Fullscreen Modes, and select the classic fullscreen mode.

Maybe you are looking for

  • Mac lost contact with HP color Laserjet 3700 via USB

    Hi, Since a few days I can't get connection anymore with my HP color Laserjet 3700 via USB-cable. My Mac recognizes the printer with its name, also states when I plug in the USB that the printer is online. However, when I want to print documents, it

  • About ZEN Micro 5GB is

    To Whom It May Concern: ??Two weeks ago, I bought a Creative ZEN Micro (5GB) mp3 player from PChome online shop. After one week, the battery can not charge normally and I believe it was broken. I don?t know it cause by your company bad quality contro

  • How to maximize a window in javafx

    i have created a frame using SwingFrame. it comes minimized by default. Please tell how can i maximie it from my code. thanks in advance.

  • XCode 3.0 cocoa-python app throws exception when importing objc

    I have created the default cocoa-python application in xcode. I then try and run it and it says that an exception was thrown. I search back through the console and apparently it could not find the module objc. After searching for reasons it is appare

  • Argument mismatch error

    I'm trying a simple click a radio button to select another radio button. I'm getting this error message: GeneralError: Operation failed. XFAObject.rawValue:2:XFA:form1[0]:page2[0]:assocType[0]:RadioButtonList[0]:click Argument mismatch in property or