Transfering th focus from JTextPane to JList

i have a JTextPane whith a JMenuBar With JMenuItem on pressing this menu
item a JList with a JScrollPane appears i want to transfer the Focus from the JTextPane to the JList i tried the method setFocusable() but it doesn't work Any ready code is welcome and rewardable thank you.

Hi,
what u will have to do is? U will have to put a key listener for the JTextArea. U will have to use the KeyEvent, and check if KeyEvent.VK_TAB, then set the focus on the component wherever u need.
Regards,
Balaji.SN

Similar Messages

  • JMenuBar, losing focus from JTextPane or other components

    Hello,
    I implment JMenuItems for copying, cuting and pasting text from one JTextPane into another JTextPane.
    The problem is that when I click on the JMenuBar-->JMenuItem, the focus from JTextPane is lost. It works fine if I use JButton on a JToolBar.
    The code below is my paste() method that does not work.
    public void paste() {
            if (sourceWindowTextPane.isFocusOwner()) {
                sourceWindowTextPane.paste();
            } else if (targetWindowTextPane.isFocusOwner()) {
                targetWindowTextPane.paste();
        }What do I need to do?

    Thank you very much, uncle_alice.
    I found a weird solution. I get the name of the current focus owner first, and then I compare the returned name with
    names of my JTextPanes. The working code is shown below.
       String focusOwnerName=this.getContext().getFocusOwner().getName();
            if (focusOwnerName.equalsIgnoreCase("sourceWindowTextPane")) {
                sourceWindowTextPane.paste();
            } else if (focusOwnerName.equalsIgnoreCase("targetWindowTextPane")) {
                targetWindowTextPane.paste();
            }However,
    although I know the the focus owner's name is "sourceWindowTextPane" from this.getContext().getFocusOwner().getName(),
    I still get false when I use sourceWindowTextPane.isFocusOwner(). For example,
       String focusOwnerName=this.getContext().getFocusOwner().getName();//-->for instance, focusOwnerName is "sourceWindowTextPane".
       if(sourceWindowTextPane.isFocusOwner()){
             System.out.println("True");
      } else{
              System.out.println("False");
    I get "False" from the code above.
    Does anyone have any idea?

  • I am transfering my stuff from my lap top to my desk top (both Mac). I cannot get my CS4 to open. It gives me a 150:30 error, licencing thing. I have no idea what to do and after hours of searching none of what I found helps. I don't know anything about t

    Sorry didn't know that the first step was just supposed to be "subject".
    So here it is again.
    "I am transfering my stuff from my lap top to my desk top (both Mac). I cannot get my CS4 to open. It gives me a 150:30 error, licencing thing. I have no idea what to do and after hours of searching none of what I found helps. I don't know anything about this stuff so please don't answer with "maybe this willl work, or maybe that."  I need a real answer please and I cannot find a way to actually contact Adobe. I also don't have a disk drive on this Mac. Thanks"
    Also please feel free to e-mail the answer because I hate looking for these answers online. It takes me forever to find this section. Not that I have even even gotten a real answer.
    [email protected]

    Hi Sonia,
    While transferring Adobe from laptop to PC the licensing files got corrupt and the right way to use Adobe Applications is to install first as transferring from a different machine can give you problems.
    You can try steps from this article if that helps otherwise you have to reinstall and manually delete some files , everything is mentioned.
    http://helpx.adobe.com/x-productkb/global/error-licensing-stopped-mac-os.html
    You can download CS4 from here:
    Download CS4 products

  • Transferred itunes library from Windows XP PC to new Windows 7 PC. plugged in 3rd gen Ipod. Ipod icon appears along with playlists, music etc. Songs are grayed out and won't play. Please help!

    I recently transferred itunes library from windows XP PC to new Windows 7 PC. The transfer was successful, however when I plug my 3rd gen Ipod Nano into the new PC, the Ipod icon appears along with the music, playlists, etc. The songs are shown but are 'grayed out' and wont play or sync.The 'Devices & Printers' window in new PC shows icon for Ipod driver & is OK. The icon for the Ipod appears but depicts a delta shaped warning icon that states that the Ipod is'not operating properly'. Tried troubleshooting. The troubleshooting message states the the Ipod is 'disconnecting'. Can you help me with this problem?        

    Then, I dropped the entire itunes file from the old PC (XP) into an empty external drive.
    That "itunes file from the old PC"?  Is that the iTunes folder, from the old PC, that was in the user home folder's Music folder?
    All of the library, playlists, etc. from the ipod as they always have been are shown, by they are 'grayed out' and will not open or play.
    That's on the iPod, correct?  Are all of your old playlists in iTunes, from the old PC, still there in iTunes on the new PC?  Are the songs in iTunes still playable?
    This document provides the steps to transfer a complete iTunes library between two computers.  See the section called External drive.
    iTunes: How to move your music to a new computer - Apple Support
    There are many steps, but this is a summary.  (1) On the old PC, consolidate all of your iTunes data into the iTunes folder.  (2) Copy this iTunes folder to the external drive.  (3) On the new PC (that has iTunes installed but NOT running), replace its existing iTunes folder with the one from the old PC (on the external drive).  When you run iTunes, it uses the iTunes folder from the old PC, and it should look like iTunes on the old PC (with all the playlists, ratings, play count, etc.), and your iPod will see the iTunes library as the same iTunes library (because it is the same library).
    If you did something different, and the old PC is still accessible, you may want to try it using the method from the linked document.

  • I have transferred my pictures from a PC to iPhoto but some have remained in a pictures folder. How can I move them to pictures?

    i have transferred my pictures from a PC to iPhoto but some have remained in a pictures folder. How can I move them to pictures?

    what is WP files?
    You want to always use iPhoto with a default referenced library (the preference to copy imported item to the iPhoto library is checked) ad then delete the source photos
    LN

  • I transfered my purchases from my iphone to my mac. All transfers completed. One particular album shows up on the phone but the songs are greyed out and don't play. Itunes shows album as purchased but album is not in my Mac library.

    I transfered my purchases from my iphone to my mac. All transfers completed. One particular album shows up on the phone but the songs are greyed out and don't play. Itunes store shows album as purchased but album does not show up in my Mac library. How can I retrieve the album.

    So i've found the answer to this by clicking on every menu and setting in the itunes store. It turns out some purchases in the cloud can be hidden probably as the result of an interrupted transfer/sync/backup or a network outage. To unhide purchases 'greyed out ' items , go to the Itunes store (on the PC) click on your account name and select view account. (you'll be prompted for your itunes password) once you are in scroll down to the purchase history section. there should be an option for hidden purchases. click through and click on unhide purchases, redownloadble purchases. any hidden purchases will then show up. click on unhide to reactivate and download. This may only work for purchases in the cloud.
    hope others find this useful.

  • How to capture the event on changing focus from a JTextField?

    Hi All,
    I have got a problem...
    I want to do something (say some sort of validations/calculations) when I change the focus by pressing tab from a JTextField. But I am not able to do that.
    I tried with DocumentListener (jtf01.getDocument().addDocumentListener(this);). But in that case, it's calling the event everytime I ke-in something in the text field. But that's not what I want. I want to call that event only once, after the value is changed (user can paste a value, or even can key-in).
    Is there any way for this? Is there any method (like onChange() in javascript) that can do this.
    Please Help me...
    Regards,
    Ujjal

    Hi Michael,
    I am attaching my code. Actual code is very large containing 'n' number of components and ActionListeners. I am attaching only the relevant part.
    //more codes
    public class PaintSplitDisplay extends JApplet implements ActionListener
         JFrame jf01;
         JPanel jp01;
         JTextField jtf01, jtf02;
         //more codes
         public void start()
              //more codes
             jtf01 = new JTextField();
              jtf01.setPreferredSize(longField);
              jtf01.setFont(new Font("Courier new",0,12));
              jtf01.setInputVerifier(new InputVerifier(){public boolean verify(JComponent input)
                   //more codes
                   System.out.print("updating");
                   jtf02.setText("updated value");
                   System.out.print("updated");
                   return true;
              //more codes
              jtf02 = new JTextField();
              jtf02.setPreferredSize(mediumField);
              jtf02.setEditable(false);
              jp01.add(jtf02, gbc);
              //more codes
              jf01.add(jp01);
              jf01.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              jf01.setVisible(true);
              //more codes
         public static void main(String args[])
              PaintSplitDisplay psp = new PaintSplitDisplay();
              psp.start();
         public void actionPerformed(ActionEvent ae)
              //more codes
    }As you can see I want to update the second JTextField based on some calculations. That should happen when I change the focus from my frist JTextField. I have called jtf02.setText() method inside InputVerifier. But it's giving error...
    Please suggest...
    Ujjal

  • How to stop Firefox windows stealing focus from other Firefox windows?

    I am using Firefox 26.0 on Windows 7 and tend to brows using multiple windows instead of tabs. Frequently when I click on a link in one window, the new page will begin to load and suddenly a firefox window that is in the back ground pops to the front, stealing the focus from the window I had been browsing in.
    There is no consistent pattern as to which websites or pages are loaded into the background windows that suddenly decide to steal focus. Likewise there is no pattern as to which links or actions I use that seem to cause this to happen.
    Is this a known issue? It is driving me absolutely nuts!

    It could be a bug in the Flash Player plugin, caused by the protected mode feature. This thread has the background on that and known workarounds: [https://support.mozilla.org/questions/955659 Opening New Windows and Shockwave Flash].

  • How do I stop my Macbook Air from transferring your information from another computer?

    Just purchased my Macbook Air. When I started it up, it asked if I wanted to tranfer information from my other computer. the first thing it started to download was the music and it suddenly froze when it had a 1hr and 46 mins left and now I can escape out of it. It is the only thing that is on my screen. I ended the transfer on my PC but it wont clear out on my Macbook Air. Is there a way to restart the computer so it will retry the tranfer without the music?

    Welcome to Apple Support Communities
    Hold the Power button until the Mac turns off, and turn it on again.
    Instead of transferring your files from another computer through the network, copy your data from your old PC or Mac to an external drive, connect the external drive to your MacBook Air and transfer your files

  • I have transferred my itunes from pc to new mac book pro. In the syncing of ipod have lost playlists. Is there a way of getting them of old pc library into itunes on mac. Seems to only allow me to do it song by song?

    I have transferred my itunes from pc to new mac book pro. In the syncing of ipod have lost playlists. Is there a way of getting them of old pc library into itunes on mac. Seems to only allow me to do it song by song?

    I have transferred my itunes from pc to new mac book pro. In the syncing of ipod have lost playlists. Is there a way of getting them of old pc library into itunes on mac. Seems to only allow me to do it song by song?

  • I want to buy a ipod as my iphone as no memory from all of my music, is there a way of transferring the music from the iphone to the ipod? i dont want to have to re download or buy all of the music again!

    i want to buy a ipod as my iphone as no memory from all of my music, is there a way of transferring the music from the iphone to the ipod? i dont want to have to re download or buy all of the music again! Don't want to buy a ipod then find out this! Please help!

    You can redownload most iTunes purchases directly to the iPod by:        
      Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Otherwise you will have to sync from your iTunes library.

  • How can I force focus from flash to another plugin app in FireFox such as with the e.focus() Java Script command in Internet Explorer

    Can you force focus from a Flash app to another plugin such as Unity3d using a JS command similar to e.focus() which works in Internet explorer. The following code works in IE, but not FireFox? Any solution would be helpful. Is it even possible?
    function hideSWF(){
    e=document.getElementById("flash_content");
    e.style.width = 1 + 'px';
    e.style.height = 1 + 'px';
    e=document.getElementById("u3dobjmsiediv_unity");
    e.focus() ;
    function showSWF() {
    e=document.getElementById("flash_content");
    e.style.width = gameWidth + 'px';
    e.style.height = gameHeight + 'px';
    e.focus() ;
    == This happened ==
    Every time Firefox opened
    == Always existed when switching from Flash app to a different app. ==
    == User Agent ==
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4

    No, I am saying that this isn't the forum for help with that. This forum is for Firefox user support, and the helpers in this forum aren't versed in development issues like that - we're volunteers, not Mozilla developers and don't work for Mozilla. You are better off asking about that in a forum where other web site developers do support.

  • Error while transferring an employee from one position to another

    When i am transferring an employee from one position to another i am not being able to do so. This position is visible in HRP10001.

    Hi,
    Have you tried using any other aciton like Org re-assignment, promotion action etc or tryid in PA30 itself?
    Regards
    ET

  • IPAD2 since yesterday seems to have stopped allowing transfers of photos from anything other than another Apple product and comes up with the message2 itunes will no longer sync photos....which are not transferred from a Mac? Looks as if there is a prob

    IPAD2 since yesterday seems to have stopped transfers of photos from non Mac equipment. I use dell with ITunes cloud facility.
    Any ideas or are we to await Mac correcting the software?

    Okay, can someone please give a useful answer? Thanks! I have been experiencing exactly the same problem for some time now, and it is very annoying. Furthermore, I would like to point out to Chris CA that there is absolutely nothing ambiguous about the original post.
    So here is the deal. I used to be able to burn CDs with iTunes that played back fine on both my car and home stereo. After some update, and I am very sorry but I really do not remember which one, as I am just a user and not a programmer and just want something that works, which in the end Apple used to be all about, and therefore do not keep track of all the updates, CDs won't play back on my car stereo. Nothing else changed, still the same brand of CDs (even the same stack!), still the same car stereo, and still the same 2007 MBP. So by simple deduction I conclude it must be a software update. And I do not care what the exact cause is, I just want a fix!
    I'd like to apologize for my tone in the above, but it is just a very annoying problem, even more so because it seems nothing is being done about it. Thanks for your answer in advance!

  • Just purchased a new iMac and transferred all info from my old iMac. Now when using iPhoto slideshow is displays the pictures in reverse order.

    Just purchased a new iMac and after transferring all info from my old iMac.  Now when using iPhoto slideshow it  displays the pictures in reverse order.

    There's a bug in iPhoto 9.5.1 and Mavericks that affects slideshows played directly from an album.  The slideshow will not play correctly if the photos have been sorted manually.  Any other type of sort, date, rating, keyword or title, will play correctly.
    If you need that manual sort of pictures for your slideshow create the slideshow in iPhoto's slideshow mode.
    OT

Maybe you are looking for

  • IOS 7 calendar; can I view activities on monthly calendar?

    just updated to IOS 7: is there a way to view activities on the monthly calendar? If not why would they downgrade it?

  • IMP-00017: following statement failed with ORACLE error 1652

    when i importing the dump file, i got such error.IMP-00003: ORACLE error 1652 encountered ORA-01652: unable to extend temp segment by 128 in tablespace TEMP. but the imp program is still going after got such error message. Do I have to stop the impor

  • How to I add a background image in an Encore slidehsow?

    How do I add a background image in an Encore slidehsow? Currently the slideshow has a black background and I would love to be able to change that to an image.

  • How to view/browse photos by keyword?

    Hi, I'm new to the forum and Lightroom. I am testing Lightroom 4 to see if it fits my needs. What I can't seem to figure out is how to browse photos by keyword without creating a smart collection for every keyword. Can anyone enlighten me if this is

  • How to join iTunes U

    Hey folks, For quite some time I have been trying to join iTunes U. I am the multimedia coordinator for St. Thomas University. I have not received a call from Apple as the e-mail explains that I should after I register and I don't seem to find a like