Trying to Add a focus listener to Jtabbedpane

Trying to add a focus listener to Jtabbedpane. This code compiles fine but I can't get the getName() method of the inner class to print when a Jtabbedpane is selected. Perhaps the focus listener isn't setup properly?...don't know...please help.
class SteelToolFrame extends JFrame {
for(i =0;names.size() > i;i++){
String hello = (String)names.get(i);
screen = new SteelScreenBean(hello);
String hi = (String)names.get(i);//names is an
//arraylist
JScrollPane v = screen.pane;
JTabbedPane r = (JTabbedPane)tabs.get(1); //tabs is
//an arraylist
r.addFocusListener(new FocListener());
(r).addTab(hi,v);
class FocListener extends FocusAdapter{
public void focusGained(FocusEvent e){
JTabbedPane tb = (JTabbedPane)e.getComponent();
System.out.println(tb.getName() + " gaincomponent");

hi , i would use r.addChangeListener();In the Listener Method you can call getSelectedIndex(). Focus is not on a Pane itself when he on a component that is on Pane.

Similar Messages

  • I just updated my iPad2 to ios7 and everything returned except my movies. Why??? I was trying to ADD a movie for my 5 year old and it said I needed a later iOS. Now he has ZERO movies!!!! Just great!!

    I just updated my iPad2 to ios7 and everything returned except my movies. Why??? I was trying to ADD a movie for my 5 year old and it said I needed a later iOS. Now he has ZERO movies!!!! Just great!! Can anyone help??

    For what it's worth, you posted this in 2011, and here in 2014 I am still having this same issue. Over the last two days, I have had to unlock my apple account 8 times. I didn't get any new devices. I haven't initiated a password reset. I didn't forget my password. I set up two factor authentication and have been able to do the unlocking with the key and using a code sent to one of my devices. 
    That all works.
    It's this having to unlock my account every time I go to use any of my devices. And I have many: iMac, iPad, iPad2, iPad mini, iPhone 5s, iPod touch (daughter), and my old iPhone 4 being used as an ipod touch now.  They are all synced, and all was working just fine.
    I have initiated an incident with Apple (again) but I know they are just going to suggest I change my Apple ID. It's a simple one, and one that I am sure others think is theirs. I don't want to change it. I shouldn't have to. Apple should be able to tell me who is trying to use it, or at least from where.
    Thanks for listening,
    Melissa

  • Trying to add KPLU jazz radio station to itunes or desk top

    Hi good people:
    I have been trying to add the jazz radio station, KPLU, to my Library in iTunes and have got as far as listing it in the library but I can't onpen it up to play the music. I have imported plug ins and tried all most everything. Some time ago I had it on my desk top and all I had to do was click it, and on she came.
    Thanks for your help: Fred

    Fred,
    Which link on this page http://www.kplu.org/whatson/indexlisten.cgi are you trying to listen to.
    I tried this one:
    New: Shoutcast MP3 32k Stream
    Click here to launch in your player of your own choice
    and it launches in iTunes with no problem.
    If you're trying one of the AACplus streams, you're out of luck with iTunes.
    VLC (Google for VLC if you don't know what it is) however does support AACplus. Drop the downloaded link on the VLC-window and off you go.
    The AACplus 20K by the way definitely sounds better than the 32K mp3 stream.
    AACplus 48K requires a plug-in, which is not available for Mac
    Strike this last remark. See edit.
    M
    Just tried the 48K link. Doesn't require a plug-in at all. Sounds good in VLC
    17' iMac fp 800 MHz 768 MB RAM   Mac OS X (10.3.9)   Several ext. HD (backup and data)
    Message was edited by: macmenno

  • How to add exiting event listener in javascript

    I am trying to figure out how to add an event listener in javascript for the exiting event when the red x is clicked on a Windows window (top right corner).
    I found this among adobe documentation, but it does not work:
    var app = air.NativeApplication.nativeApplication;
    app.addEventListener(air.Event.EXITING, closeHandler);
    function closeHandler(event) {
      alert("Goodbye.");
    And yes I have the AIRAliases.js included.
    Thanks

    The code posted above is from page 10 of the "HTML Developer’s Guide for ADOBE AIR (prerelease updated 11/16/2009)".
    I am actually exiting the program because I only have one window open and I click on the red x in the top right corner to shut it down... in theory, the example above provided by Adobe, should interrupt the exit sequence by displaying an alert box amd then shut the program down.
    Here's the excerpt from the manual...
    unload events (for body and frameset objects)
    Adobe AIR 1.0 and later
    In the top-level frameset or body tag of a window (including the main window of the application), do not use the unload event to respond to the window (or application) being closed. Instead, use exiting event of the NativeApplication object (to detect when an application is closing). Or use the closing event of the NativeWindow object (to detect when a window is closing). For example, the following JavaScript code displays a message ("Goodbye.") when the user closes the application:
    var app = air.NativeApplication.nativeApplication;
    app.addEventListener(air.Event.EXITING, closeHandler);
    function closeHandler(event)
    alert("Goodbye.");
    However, scripts can successfully respond to the unload event caused by navigation of a frame, iframe, or top-level window content.
    Note: These limitations may be removed in a future version of Adobe AIR.

  • How to make each playlist for each movie songs ? when i tried to add songs all movie songs comes in row , its very difficult to find which movie song belongs?

    how to make each playlist for each movie songs ? when i tried to add songs all movie songs comes in row , its very difficult to find which movie song belongs?

    Thank you! I put some self help hypnosis tracks to listen to on my iPod. I did not want to go to the next track automatically, I wanted to listen to them individually, one at a time. (If I fell asleep, I did not want to 'wake up' in the middle of a different track.) Your information helps me understand that I need to re-load this playlist onto my iPod from my  Mac computer, only first, I need to UNCHECK the boxes in front of each track so the iPod will STOP each time after playing the selected track. It is too bad that so many functions are not availabvle within the iPod, but that is probably why they can make it so compact.

  • I'm trying to add a playlist manually to my iPhone 4. It won't let me because it's trying to delete all of the music currently on my iPhone. Is there any way to prevent this from happening in order to start manually updating it?

    I'm trying to add a playlist manually to my iPhone 4. It won't let me because it's trying to delete all of the music currently on my iPhone. Is there any way to prevent this from happening in order to start manually updating it?

    Are you leaving the box unchecked to Manually manage music & videos? You don't need to to add anything to the iPhone.
    Simply drag the playlist to the iPhone to manually add it.

  • I am trying to add music on my Iphone 4S without deleting my current music list

    I am trying to add music on my Iphone 4S without deleting my current music list

    See this user tip: Recovering your iTunes library from your iPod or iOS device.
    tt2

  • I have garage band ver 10.0.2 and am trying to add effects to an audio track but i have no info button or track info under the track tab.  How do i get these things to show up on my program?

    I have garage band ver 10.0.2 and am trying to add effects to an audio track but i have no info button or track info under the track tab.  How do i get these things to show up on my program?

    In GarageBand 10.0.2 you can no longer add all kinds of effects freely; this GarageBand '11 feature has been discontinued. Pick one of the predefined patches that already has the effects you want.
    However, you can add effects from the predefined audio units.
    You'll see the predefined effects on the track, when you open the Smart Controls. To add audio units, click the button and enlarge the the smart controls pane by dragging the dividing line to the Track Area upwards.

  • HT1386 I originally added music to my iphone under someone elses itunes account, now that I am trying to add under my own id, it is not showing on my phone...how can I fix this?

    What do I need to do to get my music from my itunes library onto my phone? I originally added music from a diffnerent itues account, and now that I am trying to add from my own it will not transfer...however, in the bar on the bottom of itunes it shows that it is on my phone...but it does not display anywhere else and I cannot find it in my phone. Do I need to connect to the original itunes account and delete that music in order for my library to show?

    As you connect your ipod to iTunes, an option in the upper right of the screen will appear. When you click this, it will show the different menu for your ipod.

  • I am trying to add my work email to my Iphone 3 and can't get it added....any ideas??

    I am trying to add a second email/work email to my iphone and can't get it added...anyone have any ideas?

    Talk to your IT department and make sure you have the correct settings.

  • I get error message when trying to add key tags

    I get error message when trying to add key tags

    You should always backup your iPad before ever doing anything major that coould result in a catastrophic loss is something goes wrong. You can then usually restore from the backup when your iPad has recovered.
    You should also be sure to have transfered any new purchases directly to your iPad to the iTunes app on your computer on a regular basis.

  • I am trying to add movies from my Panasonic lumix to I photo but they aren't showing up.  If I try to import into Imovie they also don't show up on the sd card as importable movies.  I am using I photo 9.2 on 10.6.8 and never had a problem before.

    My camera can be set to record as motion JPEG or light AVCHD.  It was set for AVCHD.  Could that be affecting it?  If so, can you think of any way I can load these.  I am trying to add them to an IMovie I started from a different source.

    Stevomacrocket wrote:
    I had this problem.
    The answer is to close iphoto (you might have to force quit iphoto if it starts automatically when you connect the camera or insert the SD card) and open imovie.
    Imovie then presents an import page which easily imports the video into imovie.
    It is a real bad idea to "force Quit" iPhoto - if it has any update activity going on that you interrupt you can corrupt your library an close data or even photos - Force quit should ONLY be used in an emergency where there is no other alternative and you are positive that nothing is going on in iPhoto
    LN

  • I am trying to add a new credit card and it keeps telling me that I have to enter a valid security code...I have tried 2 different cards and it is doing the same thing. How do I get past this?

    I guess it has been a year since I last purchased something on I-tunes and my account is saying that they couldn't authorize my card for some of my purchases.  I am trying to add a new credit card to clear this up and it keeps saying that I have to enter a valid security code.  I have tried 2 different cards and I get the same thing.  I have also added an I-tunes gift card and that isn't clearing up the money that I owe.  It is showing that I have a $25 credit for that.  How do I fix this, I have been trying for days and all I have got from the e-mail tech support is that its my credit card issuer that is causing the problem.  Thats not correct because one of the credit cards that I am trying to use, is a prepaid Visa gift card.  I know that these work on I-tunes because I have used them before in the past.  I am getting very frustrated with this whole process, I just want to clear up my account and buy some new music!! HELP!!

    You probably ran into blocks & locks.
    iTunes Store Support
    http://www.apple.com/emea/support/itunes/contact.html
    They'll sort it out.

  • I am trying to add a game to my sons I touch pad. It is a free game. It asks for verification of password and credit card info. Every time, it tells me that my time has expired. Help.

    I am trying to add a game to my sons I touch pad. It is a free game. It asks for verification of password and credit card info. Every time, it tells me that my time has expired. Help.

    It asked me that too.Don't worry and just put it in. Itunes doesn't charge unless your son buys something. The password happens to me all the time. Credit card was only once. Just make sure your son knows not to buy anything without permission so he doesn't accidently charge you something.

  • HT1176 I am trying to add my iPhoto library to files to be backed up on time machine. I am told to click on the Options Minus butto, but it is greyed out. What is the solution ?

    I have been trying to add my iPhoto Library to files for time machine backup.
    I was instructed to click on the Options minus button - but it is greyed out and not functional. 
    What is the solution ?
    Your help will be much appreciated.
    Thank you.
    Roberto Kay 

    You can "see" the iPhoto library in Time Machine backups, but you cannot "open" the library or "browse" the contents while you are in Time Machine.
    Apple makes you restore the entire iPhoto library to another destination...like your desktop....if you want to retrieve a few older images that you may have deleted by mistake.
    This is a convoluted mess, but unfortunately, that is the way it is.
    See Pondini's excellent, detailed information on this:
    http://pondini.org/TM/15.html
    You might also want to post in the iPhoto support area to see if the experts over there might have a workaround for you. I cannot find one, but I'm not an iPhoto expert.
    iPhoto

Maybe you are looking for