JTabbedPane and a Clsoe icon

i know this has been asked before, but noone has ever answered completly
i want to add a close button <an X basically> o nthe tab itself <a la Eclipse>, and while i can obviosly put an icon there, ther eis no way to add an action listener to the tab.
i cna add an action listener to the tabpane, which will tell me that a tab was clicked on, and which one, but what i need really is a wya to see the x/y coordinates of where on the tab the click happened. This makes me think i need to overide the listener soewhere, but i am nto sure where.
thanks

You can get the location of the click by adding a MouseListener to the JTabbedPane. To map it to the tab, you'll have to use the TabbedPaneUI returned by getUI() - it has a method tabForCoordinate(JTabbedPane, int, int) which will tell you which tab was clicked, and a method getTabBounds(JTabbedPane, int) which will tell you the bounds of the tab, and allow you to work out where the click occurred within the tab. However, if you want to paint a cross on the tab as well, you'll have to write your own TabbedPaneUI with a custom paint method. You can install it with JTabbedPane.setUI.

Similar Messages

  • When I drag and drop an icon from the address bar to the desktop is does creat the shortcut but will not display the website icon, only the firefox icon, how can I display website icons?

    When I drag and drop a website icon from the Forefox address bar to the desk top, the short cut is created but the icon that appears is the firefox Icon. I want to disply the icon from the website that the short cut refers to. I have checked all I can think of in my computer to no avail.

    You have to assign the favicon yourself to the desktop shortcut (right-click the shortcut: Properties) after you have dragged the link to the desktop.
    You can usually find the favicon in Tools >Page Info > Media and save the icon there.
    Otherwise use the main domain of the website and add favicon.ico (e.g. mozilla.com/favicon.ico ) to display the favicon in a tab and save that image to a folder.

  • HP Color LaserJet Pro MFP M177fw screen frozen on hp logo and energy star icon

    My HP Color LaserJet Pro MFP M177fw screen is frozen on hp logo and energy star icon.  It has only printed the test page, and will not print otherwise.  I have tried unplugging for 60 seconds, and even uninstalled it and reinstalled it with the latest download - still no change.   None of the other icons outside the screen work either (home, help, etc.)  about all i can do is turn it off and on.  Also,  I obviously cannot make copies etc since I cannot access any of the functions. Please help! and thanks in advance!

    Hi , I read your post and see that the printer is frozen on the HP Logo and Energy Star Icon. I would really like to be able to help you resolve this issue.
    I have provided some steps to try to see if we can resolve this issue. Disconnect the USB/Network/FAX and power the printer on Standalone. Check and remove any packaging material inside the printer and toner. Do a hard reset to see if that will resolve the issue.
    Leave the printer on and unplug the power cable from the printer and wall outlet for 60 seconds.
    Then reconnect the power cable to the printer and wall outlet rather than a surge protector.
    This ensures the printer is receiving full power and may help this situation. If the issue persists, perform a power drain by disconnecting the power cord from the back of the printer and keeping the power button pressed for 30 seconds and in case of a power switch keep the switch in ON position for 30 seconds before reconnecting the power chord. Update the printer's firmware, make sure you run this through a USB connection. It may not detect the printer in this error state though. Software and Drivers. Select Option 2 and wait for the page to load and then select the link for firmware. I can send a private message with some another step to try.
    In the forum beside your handle name just click on the envelope to view it. How is the printer connected? (USB/Ethernet/Wireless) Please let me know the outcome. Have a nice day!
    Thank You.

  • Real Instruments and Master Track icons dessapeared

    This is when i open garage band
    This happen when i start to used. The Real Istruments and Master Track icons desappeared. What is this happening and how can I fix it?

    THis can either mean, that the GarageBand application needs reinstalling or that you have corrupted settings and preferences files in your user account. To find out if something in your user account needs fixing, try to launch GarageBand from a different user account.  You could try to log off and sign  into the Guest account or create a second account for testing using the System Preferences "Users&Groups" pane.
    If GarageBand works well using a different account, try HangTime's "oddball probs" fix and trash the GarageBand preferences file - move com.apple.garageband.plist from the Preferences folder in your user library to the Desktop.  See the FAQ:
    http://www.bulletsandbones.com/GB/GBFAQ.html#oddballprobs
    (Let the page FULLY load. The link to your answer is at the top of your screen)
    But if it even does not work from a different account, trash GarageBand and reinstall it.
    Regards
    Léonie

  • Have a macbook pro running osx lion, connected a kindle fire using micro usb to transfer pictures and the disk icon won't show up on the desktop.  When I ran disk utilities the kindle does show up there.  Any thoughts as to why it's not recognizing?

    Have a macbook pro running osx lion.  Connected a Kindle Fire using micro usb and the disk icon doesn't show up on the desktop.  Also sometimes get a message sayiing computer doesn't recognize device.  When I opened disk utilities the Kindle disk does show up there.  What am I missing?

    cashworth wrote:
    Kindle is connected directly, not thru a hub.  Also called Amazon Kindle support, tech was baffled when I told her I was using a Mac.  She said, "I'm not really familiar with apple products." 
    Precisely why it's not an iPad, and why it doesn't cost very much.  An Apple rep would tell you how to connect an iPad to every computer.
    Go here:  http://www.amazon.com/gp/help/customer/display.html/ref=sv_kinh_9?ie=UTF8&nodeId =200127470

  • When i customize my toolbar and close, the icons are not in the places i put them. how do i make my toolbar set up stay in place?

    below file/edit/view/history/bookmarks/tools/help menu line, on second line I have added icons for print, reopen closed tab, session manager, (xmarks)synchronize now, my xmarks, home,duckduckgo, woolik search, stumbleupon, you tube, do not track me, mask me, better privacy, https addon, zoom out zoom in, back forward, private browsing toggle. on the third line i have added icons for gmail-open in a new tab, gmail checker, gmail notifier, last pass and the address bar. there are 2 to 4 separator lines between the icons, grouping like icons, i.e., security, search engines, gmail, etc. each time i close Firefox and then reopen, the icons are no longer in the order i placed them, with separators, or they are not visible and i have to r.click. select "customize," and re-drag and drop the icons and separators where i want them. i am a very, very beginner at this all, but drag and drop i know. why don't the icons/seperators stay in place??
    thank you for you help...a. 09 fev. 2013 16h03.

    Its problem saving.
    *http://kb.mozillazine.org/Preferences_not_saved
    *https://support.mozilla.org/en-US/kb/how-to-fix-preferences-wont-save

  • I Photo, I Movie, and Photo Booth Icons are visible but when clicked on won't open.

    What can I do? I Photo, I Movie, and Photo Booth Icons are visible but when clicked on won't open.

    What happens when you try?

  • When I attach images to an email they show as the image and not an icon.  Is there a way to make the attachment an icon?

    When I attach images to an email they show as an image and not an icon.  Is there a way to have them attached as an icon?
    When I send attachments this way some people can't save them.   They can see them but not save them.
    Any ideas?

    They are received as attachments, i.e. icons. What you see is the real image on your disk, and only if small enough to be displayed. Otherwise, they are small icons inserted in the text.
    Additionally, when you place an image in the message, you will find an option in the lower right corner, otherwise absent. Use it, if need be.

  • I have an iPad 2 and the volume icon is in the middle of my screen and when i try to turn the volume down it just goes back up again and it  makes it impossible for me to play games

    i have an iPad 2 and the volume icon is in the middle of my screen and when i try to turn the volume down it just goes back up again and it  makes it impossible for me to play games or do anything

    Have you tried giving it a reset? Hold down the sleep and home keys for about 20 seconds. When you see the silver apple let go and let it reboot and see if htat helps.

  • How can i get the itunes and apps store icon on my ipad desktop?

    How can i get the itunes and apps store icon on my ipad desktop?

    Google are supposed to be working on an iPad maps app.

  • My ipod touch 4g is turning up or down by itself, and the speaker icon wont go away

    Okay this first started yesterdy morning, when my ipod touch4g was acting funny it wouldnt turn off, so i thought if i plugged it in it would fix itself, so i thought restoring would help it,made it worse it started turning off and on apple logo came on a few times, now i got it where i can turn it off and on okay but now i cant seem to controle the volume, and the speaker icon is showing and wont go away, and when i try turning it down when i play a song or a video, it will turn back up by itself, or it will turn down by itself,
    what would be the best way to fix this without taking it in? the nearest apple store is dallas and i dont wanna spend all the money in gas to go up there, and then see what arm and leg i gotta cut off to get them to fix it.
    should i restore and resync it one more time or should i start saving for a new ipod along with the new computer im needing?

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up                             
    - Restore to factory settings/new iOS device.
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar          

  • My little brother messed up with my iPod touch 4th Gen by entering the wrong password , now all data is beeing erased what should I do.The iPod is just showing the Apple Logo and some buffering icon below it.Need help fast!I'm really worried!

    I really need help this has happend 5 hours ago and the ipod os still showing the apple logo and the buffering icon below it!
    It re booted several times till now.
    Need help fast!

    - I suspect that he went to Settings>General>Reset>Erase all content and settings.  For 1G or 2G iPod that can take hours and it will likely stall out if not connected to a charging source.
    Try the following:
    - A reset.
    Reset iPod touch:  Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - The connect to computer and try to restore via iTunes.
    - Id something is still showing onthe screen, disconnect from computer/charging source and let the battery fully drain. After charging for an hour, Try the reset and restore.
    - If you can turn the iPod off, se if placing the iPod in recovery mode and then restore. For recovey mode:
    iPhone and iPod touch: Unable to update or restore

  • DETT: Set Cursor (Cursor ID) and Set Cursor (Icon Pict) VI Reference Leak

    Hi, 
    Using LV 2011 and the Desktop Execution Trace Toolkit to analyze my application, it has identified a reference link in the 2 above stated VIs. It's not a huge deal but is there any possibility I'm missing something here? Whether I use them individually or as subVIs in the Set and Unset Busy Icon VIs, it always report a reference leak. The block diagram is locked so I'm guessing there is not much I can do to correct it, but I just wanted to ask. Is this fixed in later versions? I am not calling this VI continually in a loop or anything, but I do use it quite a bit as my app is pretty user interface intensive.
    Thanks,
    Erin

    What version of LabVIEW are you using?  For LabVIEW 7.x, there was a bug in the Cursor VIs where they would only work with a certain number of created VI windows, after which point they would start returning errors (might have been error 26, I don't recall).  This bug was fixed in LabVIEW 8.0.  If you are using LabVIEW 8.x, I'm not sure what the problem might be.
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • I have an older iPod that no longer shows up in iTunes or appears to be charging.  When I press the Menu and Select buttons, the Apple logo appears and then an icon of a battery with an exclamation point.  Is it dead for good?

    I have an older iPod that no longer shows up in iTunes or appears to be charging.  When I press the Menu and Select buttons, the Apple logo appears and then an icon of a battery with an exclamation point.  Is it dead for good?

    If it is otherwise working, you can change the battery.  If you want to do it yourself, you can buy the part on eBay and other online sources.  Just make sure you know the type of iPod you have so that you get the right part.
    http://support.apple.com/kb/HT1353
    There are online guides, including the ones on this web site
    http://www.ifixit.com/Device/iPod
    (Note:  Most replacement batteries come with plastic/nylon tools seen in the guides.)
    You can also have a repair business do the work.
    If it is just the battery, if you do a Reset (using the Menu and Select buttons) while it is connect to your computer, I think it should still be recognized by iTunes.

  • TS3716 mi iPod is not recognized by itunes. I keep getting" do not diconnect " and a battery icon. Using windows 7

    My ipod nano cannot be reinstalled by itunes. I get "do not dissconect" and a battery icon. using windows 7. Any suggestions ?

    - First I would remove and reinstall all the Apple software using the following and then restoring the ipOd.
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    - Next see if manually placing the iPOd in recovery mode will allow a restore. For recovery mode see:
    iPhone and iPod touch: Unable to update or restore
    - Next try DFU mode:
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - Next try another computer/cable to help determine if you have a computer or iPod problem.
    - If the other computer works and yours does not see:
    iPhone, iPad, or iPod touch: Device not recognized in iTunes for Windows

Maybe you are looking for

  • How can I install Windows 7 by USB? MacBook late 2008 10.6.8 Boot Camp 3.0.4

    Someone please help... I have tried software update and no luck. I think my Boot Camp on Mac 3.0.4 is not showing me the right option on creating a USB installation. It asks me to load Windows 7 CD when I don't have it, I bought it online... Every do

  • Consignment processing

    Hi Friends I strongly feel that the Consignment processing in india is very much different that what is followed away. This is because of the legality and other obligations by the government. With respect to this can anybody explain the consignment p

  • Printout not sharp after replacing toner HP 100 NW175

    My HP100 NW175 is just 1 year and 2 months old. Printouts are nog sharp, even the black printouts are vaguely. Replaced the toners for official HP toners, but the printouts are of bad quality (almost unreadable). We did a cleanup/checkup/restore fact

  • Having problems with getRGB() method

    Hi, I've written an application in J2ME that allows you to use the camera and take a snapshot. The next thing I want to do is store the image that the camera takes in the RMS. Here is the code I've got so far:   void writeRecordDisplay(Image storedIm

  • Customise the gauge at ssm 10.1.

    Hi! We are new at SSM and now checking the ability of new version SSM. We get requirement from our customer to change the number of color gauge. he want 3 color (red, yellow and green) and 3 threshold. I didn't find how is possible to customize the g