Removing select components from swing JPanel

I have a JPanel that contains many different JLabels that move around to different parts of the JPanel. These components may end up occupying the same location in the JPanel.
1. How do I determine which objects is the one visible? Is it the one most recently added to the JPanel?
2. How do I selectively remove a certain component that may be in under one component and above 2 others...? This JLabel that I want to remove, does not have a specific name, instead it is indexed in an array.

steeveesas wrote:
I have a JPanel that contains many different JLabels that move around to different parts of the JPanel. These components may end up occupying the same location in the JPanel.
1. How do I determine which objects is the one visible? Is it the one most recently added to the JPanel?I would guess that much depends on the layout manager (if any used) and how you are adding the components to the jpanel.
2. How do I selectively remove a certain component that may be in under one component and above 2 others...? This JLabel that I want to remove, does not have a specific name, instead it is indexed in an array.call remove(component) on the JPanel followed by revalidate() and repaint().

Similar Messages

  • How to remove an ImageIcon from a JPanel.

    I'm kind of new to java, and I'm trying to write a simple program that will change a picture in a window when a button is clicked. Is there a simple way to remove an ImageIcon from a JPanel. I tried the remove() method, but it says there is no constructor to handle remove(ImageIcon). This is the error I'm getting. I can/will post my code if you think it's necessary, but I didn't think it would be needed.
    PicChanger.java:64: cannot find symbol
    symbol : method remove(javax.swing.ImageIcon)
    location: class javax.swing.JFrame
    frame.remove(ii);
    ^

    Oh wow, that changes everything. Thanks for the information! Can't believe I missed that.

  • Removing pligin components from JCAPS5.1.0?

    Hi,
    We are using JCAPS5.1.0 and we have set up repositry ,in which we
    have installed some of the components like LDAP eWAY,Swift OTD
    Library,Weblogic eWay,but we are not using those components in
    our project,hence we need to remove this plugins from
    repositry.But we are not able to find any way to remove those
    components,
    If anyone have removed/uninstalled the plugins components from
    repositry please let us know how to do the same...
    Thanks.
    Renga.S.

    This might defeat the purpose a bit of removing all the components, but you could try justa dding an empty panel to the JSplitPane, so when you remove you previous Components try
    splitPane.removeComponent(bottomPanel);
    splitPane.setBottomComponent(new JPanel());This should get around the resizing but kinda defeats the purpose!

  • Can't figure out how to remove select music from my iPhone 4 with the new iTunes

    My old PC with all my music on iTunes died, and I need to remove some music from my iPhone 4 to make room for the new OS update. I downloaded iTunes on a different computer and tried to sync the iPhone to it, to move all the music on my iPhone to iTunes so I could deselect what songs I wanted to remove to make the storage space. I can't figure out how to do this with the new (non-user-friendly) iTunes update. When I sync the phone, the only songs that show up are the ones I have purchased on iTunes, but non of the songs/albums that I transfered from CDs. I don't want to reset my phone to delete ALL my music, just select songs/albums. Can anyone please help me figure out the new iTunes to be able to do this? It is driving me nuts and I'm getting really mad at Apple for their constant updates making things less easy to use!

    i have the same problem, if u find it out please let me know :C i can erase or put new songs from my pc to itunes u.u

  • How to remove selected image from a light table?

    According to the Aperture User Manual, when I select an image on a light table, I should be able to remove it (while still leaving it in the light table browser). However, this seems to work only for the image I most recently added to the light table -- when I select an image I added just before the most recent, the button at the upper left for "Light Table Put Back Selected" is grayed out. (Also, the command-shift-P shortcut shown in the tooltip doesn't do anything.) Am I misunderstanding the use of this button? Doing something wrong? I added some images, and decided I wanted to put a few of them back, but can't figure out a way to do that. Makes the light table pretty useless except for layout of a set of images you are already committed to. Doesn't seem possible.

    Hey, thanks -- everything worked as you described. It never would have occurred to me that the "put back" button refers to the browser selection not the layout selection, for reasons I give below.
    I think Aperture exhibits some conceptual confusion here. First of all, a "light table" is created by the New > Light Table command, and you add images to the newly created light table just as you would add them to an album. But those images don't go on the light table layout until you drag them from the browser to the layout table. The "put back" button and "remove from light table" contextual menu command both mean remove from the layout. The phrasing of the contextual menu command make it sounds as if it will remove the clicked image from the light table's collection of images, like removing an image from an album -- it would have made more sense to name this command "put back". Furthermore, the "put back" button is above the layout display, not above the browser, which to me implies that it applies to selections in the layout display. To select an image in the browser, and click "put back selected" seems backwards -- if you just selected the image in the browser, your attention is focused on the browser, not the layout; from the browser's point of view, the button should read "bring back" not "put back".
    The documentation didn't really help when I was trying to figure this out. Sometimes the Aperture documentation refers to just a "light table", as on the overview on page 732. On pages 733 and 734, though, it refers to a "light table album". On page 735 of the Aperture manual there is a very brief explanation of how "to add images to the light table" and "to remove an image from the light table". Here, "light table" refers to the layout not the album. The explanation of the "Put Back Selected" button says to select an image then click the button, and the picture shown is of an image selected in the layout, not in the browser.

  • HT1923 IF I totally remove itunes & components from computer--do I LOSE my music library?

    I've been getting the R6034 error message--and my question is: IF I totally remove itunes and its components from my Windows 7 computer in order to reinstall it--do I LOSE my whole library of music?

    excuse my denseness--but I just realized that I could buy a large enough external hard drive and then copy the "my music" folder onto it...

  • Removing selected items from listbox

    Hi ADF Experts,
    I have a selectmanylistbox with few values displaying in UI and a Remove Button at the bottom.
    User selects certain items from the listbox and clicks on Remove button. The selected items should be reomved. Can anybody suggest how to do this.
    Thanks,
    Animesh

    Duplicate of https://forums.oracle.com/thread/2562542
    User, please don't ask the same question multiple times. If you don't get the answer you want it may be because you did not give the right information and or use case me understand.
    Timo

  • How do I remove select songs from my iPhone?

    I am trying to delete select songs/albums from my iPhone since it is almost over capacity. Apple doesn;t seem to want to make this an easy task... There are songs I simply don't want anymore, and can't seem to remove them from my iPhone 4...

    AtRi-X wrote:
    You can delet by swiping your finger from left to right which will bring delet button ,this wont work on playlists so basically you can't delet individual song from playlist
    Yes, you can delete individual song in a playlist.
    In playlist, tap Edit button (top left), tap on the left of song, tap red Delete button.

  • How do you remove STATEFUL components from memory in EAServer?

    This is from one of the books on Powerbuilder/EAServer:
    "So the major difference between stateless and stateful components is that stateless components
    automatically invoke the component deactivate event when a method call ends and the component
    is logically removed from memory. A stateful component remains in memory until physically re-
    moved by the caller."
    What does the caller (client Powerbuilder program) do to physically remove a stateful component from EAServer?
    Thanks,
    Mark

    Hi Mark
    Not sure...
    Do you know the component is in memory because memory hasn't been released?
    In which case you could check that the destroy event happens and use it to explicitly clean up.  This should really be in the deactivate event in case you do start pooling.
    From memory, (pardon the pun) there were memory leaks in EAServer version 10 years ago. A very small part of a component could take up lost space, eventually leaving only smaller and smaller chunks free, ultimately causing decline in performance and failure.
    Do you know the component is in memory because Jag Manager tells you after you have refreshed to folder?
    Lars

  • How select components from Creative cloud?

    about 2 weeks ago I paid for student version of Creative Cloud but then my laptop got infected
    I am just now getting around to downloading my components of Creative Cloud (Photoshop CC)
    but have no idea how to proceed...
    can you email instructions to
    [personal information removed... Mod - https://forums.adobe.com/docs/DOC-3731]
    [This is an open forum, not Adobe support, please do not post personal information]
    I opened case number 0214835446

    Log in to your paid Cloud account
    -Sign in help http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html
    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
    -http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html
    http://www.adobe.com/products/creativecloud/faq.html
    http://helpx.adobe.com/creative-cloud/help/install-apps.html to install or uninstall
    http://forums.adobe.com/community/download_install_setup/creative_cloud_faq
    What it is http://helpx.adobe.com/creative-cloud/help/creative-cloud-desktop.html
    Cloud Getting Started https://helpx.adobe.com/creative-cloud.html
    -Install, update or UNinstall, and launch after installing

  • Help again for removing Oracle components from Windows NT machine

    I want to remove all oracle stuff from my Windows NT machine.I have a problem to do it.I did following:
    1.Stop all Oracle involved services.
    2.delete all registry involved in Oracle.
    3.delete all folder involved Oracle.
    But I cannot delete following registry key:
    LEGACY_ORACLEAGENT80
    LEGACY_ORACLECLIENTLISTER
    LEGACY_ORACLEHOME81TNSLISTENER
    LEGANCY_ORACLEDB8
    LEGANCY_ORACLESERVICEORCL
    LEGANCY_ORACLESERVICESPORTS
    LEGANCY_ORACLESNMPPEERMASTERAGENT
    LEGANCY_ORACLESQLSERVICESV8.0SQLSRVCONFIG
    LEGANCY_ORACLESTARTOAS40_WEBSITE40
    LEGANCY_ORACLESTARTORCL
    LEGANCY_ORACLETNSLISTERER80
    LEGANCY_ORACLEWEBBASSISTANT
    LEGANCY_ORACLEWEBBASSISTANT0
    LEGANCY_ORACLEWWWLISTENER40ADMIN_WEBSITE40
    LEGANCY_ORACLEWWWLISTENER40NODE_WEBSITE40
    LEGANCY_ORACLEWWWLISTENER40WWW_WEBSITE40
    I have already deleted all Oracle folders.
    The status in my machine now is: no Oracle folder,no registry keys involved Oracle excopt above Keys.
    Any help is appreciate.

    Thank you very much.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by [email protected]:
    These are internal Windows registry keys - you do not need to delete them
    Jason Pepper
    Snr Product Manager
    Oracle Enterprise Internet Tools<HR></BLOCKQUOTE>
    null

  • Grouplayout link size of components from different jpanels

    Hi,
    i have a gui in which i has 5 panels (layed out from top to bottom in one column, using grouplayout).
    now inside each of the panels it looks like this (they use grouplayout as well):
    label 1          component
    labelexample 2     componenthowever, the labels arent always the same size, e.g. the labels in panel 3 are 50% longer than the ones in panel 5
    so all in all it looks like this:
    label 1            component
    labelexample 2      component
    label 1                    component
    labelexample_takesmorespace 2      component
    label 1 component
    label 2 componentI'd really like all the labels be the same size, so that the components all start at the same line. ive tried layout.linksize in the main frame, but this doesnt work, since the jlabels arent in a group in the main frame layout :( ( --> an exception is being thrown)
    is there a way to do this? Any help apprechiated :)
    Edited by: kaori_chan on Jul 21, 2010 7:43 AM

    If the preferred sizes (strictly speaking, preferred widths) of all the "component" components in your layout are the same, it should be fairly trivial using a GridBagLayout with appropriate weightx and fill constraints.
    db

  • HT201628 I accidentally removed some components from itunes (uninstalled) and now it won't function.  If I uninstall and reinstall, will my data be recovered...downloads, etc?

    I accidentally uninstalled some components of itunes when i repaired my PC.  now itunes won't work.  If I uninstall and reinstall, will I lose all my data?

    Your data will remain as is. Back it up anyway.
    (88923)

  • Remove selected from checkedlistbox?!

    I want remove selected items from checklistbox
    i used
     checkedListBox1.Items.Remove(checkedListBox1.SelectedItems);
    this not work well

    If you do the checking in the checkedListBox1_ItemCheck method:
    for (int i = 0; i < checkedListBox1.Items.Count; i++)
    if (i != e.Index)
    checkedListBox1.SetItemChecked(i, false);
    else if you want to check/uncheck the ticks in some other metohd, like on a button press:
    for (int i = 0; i < checkedListBox1.Items.Count; i++)
    if(checkedListBox1.item[i].checked)
    checkedListBox1.item[i].checked = false;
    else
    checkedListBox1.item[i].checked = true;
    Some additional info:
    http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/89e37fe3-ca78-4057-bf28-575bcec22f30
    http://www.eggheadcafe.com/community/aspnet/2/10043218/c--change-item-check-state-to-item-in-checkedlistbox.aspx

  • Apache Sling JCR Resource Resolver to remove selected pattern

    Hello,
    I have a requirement to remove selected pattern from all urls. Pattern will look like:
    <domain>/content/mysite/en/section1.html -> <domain>/section1.html
    <domain>/content/mysite/en/section1/cat1.html -> <domain>/section1/cat1.html
    <domain>/content/mysite/en/section1/cat1/page.html -> <domain>/section1/cat1/page.html
    I am new to mappings so looking for help from expert.
    Thanks for your help in advance.
    Regards,
    Mohit

    Does your domain represent a language? If there is no relationship between domain and the paths you are removing (for example www.mysite.com maps to /content/mysite/en and www.mysite.fr maps to /content/mysite/fr) then you can just use the resource resolver and not have to use /etc/maps approach. You would add /content/mysite/en/-/ to the resource.resolver.mapping property of the JCR Resource Resolver (make sure that the last property is /-/. You can do that either in the OSGI Felix console or via OSGI repository configuration.
    If you are using Dispatcher for caching you need to consider using Apache mod_rewrite for handling the incoming mappings. If you rely solely on the JCR Resource Resolver (or and /etc/maps approach) you can cause problems with cache flushing. If you don't use Apache mod_rewrite to change /section1.html to /content/mysite/en/section1.html then the request gets cache in the docroot as /section1.html. When you publish a change to /content/mysite/en/section1.html Dispatcher will not make the propery association and will touch the wrong stat file. Now if your stat file level is set to 0 and you set up to auto-invalidate HTML you will probably not notice the impacts immediately. If however you set your stat file level above zero, or you have non-standard auto-invalidation settings you may have problems with your cache flushing. In general anytime I do I am using Dispatcher I use Apache mod_rewrite to handle incoming rewrites. I still configure the JCR Resource Resolver to handle both incoming and outgoing rewrites so that I can test the site directly against the publish server if I need to, but I'll set up mod_rewrite to handle incoming rewrites and avoid any cache flush issues.
    For SEO purposes in scenarios you will want to configure Apache mod_rewrite to prevent requests directly to the full path. Often times you will either have an outgoing link not get rewritten to the short URL, or someone will send out the full link by accident so you will want to prevent those links from working - potential by doing a 301 redirect of /content/mysite/en/section1.html back to /section1.html. This prevents SEO issues, but you do have to make sure you don't create an infinte loop since the redirected request will then get rewritten to the long URL.

Maybe you are looking for

  • Mounted volume not seen by Finder

    I have 2 AFP shares on the same volume of a G4 Xserve (10.4.8, but problem has been going on for at least a couple updates), with different permissions (Open Directory users, ACLs). I've run into a problem fairly frequently lately where users with ac

  • LION - Safari missing plug-in

    Well, LION 10.7.1 is here....informing us "Address an issue that may cause the system to become unresponsive when playing a video in Safari".... the  "Missing plug-in" issue has not been fixed, no change at all. Not sure what kind of UAT testing they

  • Use of callback in JAAS

    hi i don't understand yet the use of the callback I notice in sun documentation that NameCallback,for example, Construct a NameCallback with a prompt but in my case (i use JAAS in web application) i don't get the username from prompt but from an inpu

  • Episodes/Song in Reverse Order

    I upgraded my iPod Touch software to 2.2, and all of the chapters in my audiobook podcasts are now in reverse order. (They are downloaded from Librivox.) All of the chapters are in correct order on iTunes and when my iPod is hooked up to iTunes, the

  • PO CANCELLATION LETTER

    HI GURUS, PLESAE LET ME KNOW... WHETHER *PO CANCELLATION LETTER..*. POSSIBLE WITH STANDARD SAP.. BY CREATING NEW MESSAGE ... OUTPUT OR SOMETHING PLS PROVIDE YOUR VIEWS AND SUGGEST tHANKS