How do I move focus from date chooser bean to JTable?

Here's the scenario:
I have a panel containing a date chooser bean which is in the north of my main frame.
I have a JTable (inside a scroll pane) which is in the center of my main frame.
The table (through it's table model) is a registered listener of the date chooser so that when the date is changed, the table gets refreshed.
Problem I have is that AFTER the table gets refreshed, I want focus to go to the table and, specifically, have the first row high-lighted. I haven't been able to figure out how to do this.

The table (through it's table model) is a registered listener of the date chooser so that when the date is changed, the table gets refreshed.I don't really understand this. A table can have many rows and many columns, so how do you know which cell of the table is updated?
I want focus to go to the table and, specifically, table.requestFocusInWindow();
have the first row high-lightedtable.changeSelection(...);

Similar Messages

  • Just bought a new macbook w/ mtn lion. transferred data from my old macbook over n it created another user name. that's actually good--xcept for music, which i want on my new acct. How do i move files from my "old comp" acct to my new one?

    i just bought a new macbook w/ mtn lion. when i transferred data from my old macbook over, it created another user name (i called it "old computer"). That's actually good--I'm not going to be accessing old files frequently--except for music, which i want on my new user name. How do i move files from my "old comp" account to my new one? Is there a way to easily move large #'s of files, or just one by one? I've googled extensively but can only find instructions for OSX 10.6 and previous, which talks about the "Shared folder," which I can't seem to find.      

    jesster03 wrote:
    i just bought a new macbook w/ mtn lion. when i transferred data from my old macbook over, it created another user name (i called it "old computer"). That's actually good
    That's actually bad. Peruse Pondini's Setup New Mac guide and seriously consider starting over.

  • How to move focus from one JTree node to another one and then back again?

    Hi all!
    Say I have a very simple JTree
    package main;
    import java.awt.BorderLayout;
    import java.awt.Container;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTextField;
    import javax.swing.JTree;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.event.TreeSelectionListener;
    import javax.swing.tree.DefaultMutableTreeNode;
    public class SelectableTree extends JFrame implements TreeSelectionListener {
        public static void main(String[] args) {
            new SelectableTree();
        private JTree tree;
        private JTextField currentSelectionField;
        public SelectableTree() {
            super("JTree Selections");
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent event) {
                    System.exit(0);
            Container content = getContentPane();
            DefaultMutableTreeNode root = new DefaultMutableTreeNode("Root");
            DefaultMutableTreeNode child;
            DefaultMutableTreeNode grandChild;
            for (int childIndex = 1; childIndex < 4; childIndex++) {
                child = new DefaultMutableTreeNode("Child " + childIndex);
                root.add(child);
                for (int grandChildIndex = 1; grandChildIndex < 4; grandChildIndex++) {
                    grandChild = new DefaultMutableTreeNode("Grandchild "
                            + childIndex + "." + grandChildIndex);
                    child.add(grandChild);
            tree = new JTree(root);
            tree.addTreeSelectionListener(this);
            content.add(new JScrollPane(tree), BorderLayout.CENTER);
            currentSelectionField = new JTextField("Current Selection: NONE");
            content.add(currentSelectionField, BorderLayout.SOUTH);
            setSize(250, 275);
            setVisible(true);
        public void valueChanged(TreeSelectionEvent event) {
            currentSelectionField.setText("Current Selection: "
                    + tree.getLastSelectedPathComponent().toString());
    }All I need is to move focus from currently selected node, to some other node (does not matter which one), then to "sleep" for a second and finally move it back to return selection to the previously selected node. The only question is how do I do this?

    Use a Seperate Thread to do it:
    Runnable r = new Runnable() {
        public void run() {
                   int k=tree.getSelectionRows()[0];
                   DefaultMutableTreeNode node = (DefaultMutableTreeNode)tree.getLastSelectedPathComponent();
                                if(node.getNextSibling()!=null)
                                     tree.setSelectionRow(k+1);
                                else
                                     tree.setSelectionRow(k-1);
                                sleepe(k);
    public void sleepe(int i){
                         try{
                                Thread.sleep(1000);
                                     }catch(Exception e){
                                         e.printStackTrace();
                                  tree.setSelectionRow(i);
        }Then start this thread in a mouse click event(or any other similar),but not in TableSelectionListener because >>if the current selected row is 1 then it will execute the valueChanged method of TableSe..li. and we set the selected row to 2 then again it will execute the valueChanged method of TableSe..li.It will repeat till something,or in error.
    tree.addMouseListener( new MouseListener(){
    public void mouseClicked(MouseEvent e) {
                       new Thread(r).start();
    public  void mouseEntered(MouseEvent e) {
    public  void mouseExited(MouseEvent e) {
    public  void mousePressed(MouseEvent e)     {
    public  void mouseReleased(MouseEvent e) {
      });Note:it worked perfectly for me. So add all the above in the right place and import necessary.It will execute perfectly.

  • How do I move music from one apple ID to another

    How do I move music from one apple ID to another?

    If you want to change your iCloud ID to another existing ID you'll have to delete the account, create a new account with the other ID, and migrate your data (including the calendar) to the new account.  To do this, first go to Settings>iCloud on your iPad and turn all data you are syncing with iCloud (contacts, calendars, etc.) to Off.  When prompted choose to keep the data on your iPad.  After everything is turned off, scroll to the bottom and tap Delete Account.  (Note, this will delete the account from your iPad but not from iCloud.  The account will remain in iCloud if anyone else chooses to remain signed into it an continue to use it.)  Next, set up the new iCloud account using your new ID, then turn syncing for your data (contacts, etc.) back to On.*  When prompted, choose Merge.  This will upload the data to your new account.
    * If you only want to upload the calendar, only turn Calendar to On; but I'm assuming you will be the owner and want this to be your iCloud account on your iPad with all your data, and then your can share the calendar with others and administrate it.

  • How do i move pictures from one iphone to another?

    How do I move pictures from one iphone to another?

    Photos in the Camera Roll are included with the iPhone's backup. You can transfer the backup from one iPhone to another which will include all data included with the backup.
    Photos and videos in the Camera Roll can be imported by your computer. After importing from one iPhone, the photos can be transferred to another iPhone via the iTunes sync process.
    Photos in the PhotoStream on one iPhone running iOS 6 can be made available on another iPhone running iOS 6 by creating a shared PhotoStream album, or if the same iCloud account is accessed on both iPhones, the PhotoStream album will be identical on each iPhone.

  • I have playlists on my original iPod but are not in the library.  How can I move them from the iPod to the library?

    I have playlists on my original iPod but are not in the library.  How can I move them from the iPod to the library?

    She can choose to either enable the setting on her iPod to Manually manage music and videos.  With setting enabled she can sync content to her iPod from multiple computers without it affecting whats already stored her iPod. For more information on syncing content to an iPod manually see this article. 
    http://support.apple.com/kb/ht1535
    However, I would recommend copying whats on her iPod to her iTunes library first.  There are several ways to accomplish this.  See this older post from another forum member Zevoneer discussing the different ways to do it.
    https://discussions.apple.com/thread/2452022?start=0&tstart=0
    B-rock

  • How do I move pictures from old iphone to new iphone

    How do I move pictures from old iphone to new iphone

    If you want to transfer your camera roll photos, along with text messages and other data and settings from your old phone to your new one, back up the old phone then restore the backup to your new one (see http://support.apple.com/kb/ht2109).  If you only want to transfer the photos, import them from your old phone to your computer as explained here: http://support.apple.com/kb/HT4083, then put them in a folder and sync them to your new phone by selecting the folder on the Photos tab of your iTunes sync settings and syncing.  (Be aware that photos synced to your phone using iTunes can only be deleted later by syncing them off again.  They can't be deleted directly on the phone.)

  • How can I move videos from Revolution phone to mac?

    How can i move videos from Verizon Revolution to Mac? My computer is Mac os x version 10.5.8
    I have several videos that are too long to send via email, which is how I have been moving pictures and videos. I plugged it in using the USB port. The phone says I'm connected via usb. My mac brought up a box warning that the "cd connected" is not readable.

    Hi ..
    You can use the Image Capture app located in your Applications folder to import vidoe content from the phone to your Mac
    Instructions here >  Using a camera with your Mac - Apple Support
    If you have problems, make sure your Mac's software is up to date.
    Open System Preferences > App Store then click:  Check Now

  • How can i move contacts from other accounts (eg: gmail,hotmail etc) to icloud account.

    Hi All,
    I have setup icloud in my Iphone 6 running 8.1.2. and it is logged in by enabling Contacts in icloud settings. My contact list contains 1718 Contacts. I manually backed up my data into icloud including my contacts without Passbook & Documents data. But when i logged into iCloud.com to see the contacts it is not there.
    I also find when i checked only the Icloud contacts "there are no contacts showing in my contact list". I think this is the reason why there is no contacts in icloud web too. Then how can i move contacts from other accounts (eg: gmail,hotmail etc) to icloud.

    I assume you're using GMail as your primary e-mail account?  Try this.  This is how I am setup.  Not only will it move all your contacts to your phone but any changes made in GMail or on the iPhone will be sync'd with the server.
    http://www.google.com/support/mobile/bin/answer.py?answer=138740
    Note... I think this will delete your existing contacts from your device.  You will want to use iTunes to back them up and get them imported into GMail before you sync your device wtih GMail.

  • How do i move photos from iPhotos to an extern hard disk

    how do i move photos from iPhotos to an extern hard disk

    Specifically from?
    You export them: File -> Export
    This User Tip
    https://discussions.apple.com/docs/DOC-4921
    has details of the options in the Export dialogue.
    Or if you want to, you can keep the images in iPhoto and move the Library to an external:
    Make sure the drive is formatted Mac OS Extended (Journaled)
    1. Quit iPhoto
    2. Copy the iPhoto Library from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.
    Regards
    TD

  • How can I move music from a hard drive to iphone

    How can I move music from a hard drive to iphone?

    Import it into an iTunes library and then sync the iPhone with that library. If desired, launch iTunes with the Shift key held down and create or choose an iTunes library on that drive.
    (106987)

  • How do I move pictures from Mac to ipad

    How do I move photos from Mac to iPad?

    Connect the iPad to your Computer and sync with iTunes.
    Your iPad will appear in the "Devices" section in the iTunes Library Inspector.
    Select it and click the "Photos" tab. Choose which events and albums you want to sync.
    Press "Sync"
    If your MacOS X version does support iCloud, you can also add the pictures you want to copy to your iPad to the PhotoStream.

  • How do I move projects from aperture to create space and keep images on external hard drive

    How do I move projects from my iMac aperture 3 to an external hard disk so I keep all originals and create space on my iMac

    Do you want to move your complete Aperture library to an external volume or only selected projects?
    Get yourself an external drive that is formatted MacOS X Extended (Journaled) and connect it to a fast port, Thunderbolt, USB 3, for example.
    As a precaution repair your Aperture library using the Aperture Library First Aid Tools (Repairing and Rebuilding Your Aperture Library: Aperture 3 User Manual) and make a current backup, before you proceed.
    To move all projects to that drive simply drag your Aperture library to the external drive. Then click it in the Finder to launch Aperture on the new library and test it thoroughly, before you delete the old library.
    To move selected projects to the new drive, select the projects in Aperture and use the command "FIle > Relocate originals" and select a folder on the external drive as the destination in the File Chooser. See: Aperture 3 User Manual: Working with Referenced Images
    Regards
    Léonie

  • How do i move music from iphone to pc - not all downloaded from itunes store?

    how do i move music from iphone to pc - not all downloaded from itunes store?

    iTunes includes an option to transfer content that was purchased from the iTunes Store from an iPod or iPhone, but this is for content that was purchased from the iTunes Store only.
    With your iPhone connected and without syncing, at the iTunes menu bar go to File and select Transfer Purchases From - the name of your iPhone.
    This is one of the reasons why maintaining a backup of all your important data (including your iTunes library) stored on an external drive used for backup purposes only, or on other media such as CD or DVD is so important.

  • HT204053 how can i move information from mobileme to icloud/

    how can i move information from mobileme to icloud

    MobileMe has closed, it is no longer possible to get data from it.

Maybe you are looking for

  • Working with layers | Learn Photoshop Elements 11 | Adobe TV

    In this movie, author Jan Kabili discusses using layers in the Editor workspace in Photoshop Elements 11. Jan explains what layers are, why you might choose to use them, and how to create and work with layers in the Layers panel. http://adobe.ly/SBQu

  • Hooking up Video Camera

    I have a Canon ZR65 and a brand new MacBook. I want to hook the camera up to import into iMovie. When I do it says that it doesn't detect a camera. What am I doing wrong? help, this is so frustrating!!!!!

  • Japanese in the installation box? -.-!

    I bought Lion about 2 weeks ago, it was probably 2 or 3 days after its release..... I wiped the system before installing it, because I think there are always gonna be a few incompatible apps and since my macbook was running a bit slow... I figured I'

  • Can I set a password so that browser history cannot be deleted

    Can I set up my browser so that history of website FAA cannot be deleted without connecting to a computer or other device?

  • CS 5 and CS 5.5

    yea im just wonderign whats the difference about them .