Remove item/image from JFrame

hi,
i'm trying to remove this item called reels[0] which is an image from the ContentPane
public class FruitMachine extends JFrame {
     DGESpinnerHold []      reels;
     JButton          jBspin;
     MoneyBox          money;
     boolean          taken = false;
     public FruitMachine() {
          setTitle("Will's Fruit Machine");
          addWindowListener(new WindowAdapter() {
     public void windowClosing(WindowEvent e) {
     System.exit(0);
          reels = new DGESpinnerHold[3];
          for(int i = 0; i < 3; i++) reels[i] = new DGESpinnerHold();
          getContentPane().setLayout(new BorderLayout());
          getContentPane().add(reels[0], BorderLayout.WEST);
          getContentPane().add(reels[1], BorderLayout.CENTER);
          getContentPane().add(reels[2], BorderLayout.EAST);
          Action action = new AbstractAction("SPIN REELS OR CLAIM PRIZE") {
     // This method is called when the button is pressed
     public void actionPerformed(ActionEvent evt) {
          if(taken == false &&
reels[0].reel.imageNo == reels[1].reel.imageNo &&
reels[0].reel.imageNo == reels[2].reel.imageNo) {
               money.save(5);
               taken = true;
          else {
               if (money.how_many_left() <= 0) {
                    getContentPane().remove(reels[0]);
               } else {
                    if (money.spend_one() == false) return;
                    for(int i = 0; i < 3; i++) {
                         reels.startSpin();
                    taken = false;
as you can see i have tried using getContentPane().remove(reels[0]);
tmany thanks, Will

...and so, what is the result ?
BTW: after removing the component from frame, a good habit is to use revalidate() or reppaint()on it.

Similar Messages

  • In My iphone 5s,i have disabled automatic download from whatsapp app.So whichever images,video i feel is good i download them and then save them to my camera roll section.So i want to know how can i remove the images from cache of my phone.

    In My iphone 5s,i have disabled automatic download from whatsapp app.So whichever images,video i feel is good i download them and then save them to my camera roll section.So i want to know how can i remove the images from cache of my phone which are downloaded and not saved,but they remain in cache.
    Even in some apps i have data which i want to remove,but cant find a way to remove them and they are in my cache eating up my memory.

    Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.

  • How can I remove an image from its background and save it? (Photoshop cs6)

    Hello,
    I am very new to the photoshop world and am trying to remove an image from its background ( as a stand-alone) and save it. Is there a way to do this in Photoshop CS6?  I have looked at tutorials but only found how to remove the image but not how to save the image as a stand alone with no background.
    Any help would be appreciated
    Erika

    Hi Erika,
    Are you trying to save a portion of an image with a transparent background? It may help to post a screenshot of the image that you're working with as well as your layers panel.
    I've included a few tips below that may help you with your situation. If you need additional help, please feel free to post again
    Deleting a background and saving an image with a transparent background
    1. Here I am working with an image of a santa hat that I've cut out from a white background. I have two layers, the cut-out santa hat and the original file. I'm going to delete the background layer so that I have just one layer - the cut-out santa hat:
    2. You'll see that a checkerboard pattern has appeared behind the santa hat. This means that the background is transparent.
    3. You can then go to File > Save As... and select PNG, Photoshop PSD, or TIFF from the Format dropdown menu. These file formats will save the cut-out portion of your image on its own, while preserving the transparent background.

  • My RGB colors are turning to cmyk while bringing image from illustrator or photoshop. Why?  Removing the image from that page bright RGB colors are back.. hmm

    My RGB colors are turning to cmyk while bringing image from illustrator or photoshop. Why? 
    Removing the image from that page bright RGB colors are back.. hmm

    Edit > Transparency Blend Space > Document RGB

  • How do you remove duplicate images from your all images file on your mac desktop

    How do you remove duplicate images from your all images file on your mac desktop?

    Don't under any circumstances.
    All images is not a file. It's not a place. It's a list. Specifically, it's the result of an instruction: List all the images on my machine.
    When you delete something from All Images, then you have no idea what you're removing from where - files that are part of word processing docs, interface elements, corrupting your iPhoto Library. There are many perfectly legitimate reasons why you might have what appears to be duplicates but are not.
    Rule number One: Never delete anything on your machine whose job you don't understand.

  • Remove ALL Images from PDF Export?

    I'd like to remove ALL images from a PDF export (Indesign CS6), with the intention of having the smallest file size possible for review. All the images are Photoshop PSDs.
    I have created a PDF Preset (PDF 1.7) that omits EPS, PDF and Bitmap.
    That covers any PSDs that contain opaque backgrounds, i.e. are considered to be non-transparent. However, any PSDs that do NOT contain such backgrounds still appear in the exported PDF. I assume they are NOT considered to be Bitmaps?!?
    I've gone for maximal compression of images (in the Preset) also just to see how small I can get the file, but it's still over a meg, and I'd really like even smaller. I live in a rural part of England where net access is painfully slow, and even a few meg of data takes far too long to upload, not to mention the constant drop-outs. Consider further that my document is likely to grow by several orders of magnitude and hopefully you can see why I'd like to sort this issue out as soon as possible.
    I've not done any scripting but assume it would be trivial to hide images with a script. However, I'm not sure how such a script might know how to make visible only the images that were previously hidden by the script. Obviously I would not wish to unhide images that must stay hidden. Maybe some form of image/object tagging, if that's even possible in this product, i.e. tag them "temp hide" on first pass of the script, and so forth.
    Any suggestions much appreciated.
    Regards,
    James

    @James – to mark the container frames of the nonprinting images by a fill color, you could add the following lines of code in the for loop:
    allGraphicsArray[n].nonprinting = true;
    //The parent of the graphic is the container that holds it.
    //We could use it to fill it with a tint of e.g. 20% of black:
    allGraphicsArray[n].parent.fillColor = "Black";
    allGraphicsArray[n].parent.fillTint = 20;
    But this approach will add a new problem for images, that only use a portion of the holding graphic frame. Or are only partly visible due to a clipping path or a clipping mask or totally transparent areas due to transparent pixels.
    Already colored backgrounds will be recolored…
    @Sandee – I see the advantage of the PostScript to Distiller way in this situation, but there are two disadvantages:
    1. Live transparency will be flattened (could be no issue in this use case, but you never know).
    2. The gray area with the big X will be applied also to parts of the images where no pixels are present (transparent pixels in PhotoShop or TIFF files).
    To work around all these issues we need a more complex script that is building a  path object around the transparent parts of an image or using an applied clipping path for that purpose and fill that with a gray tint (and maybe with an X).
    Here some screen shots to illustrate the problems (with or without using PostScript/Distiller):
    1. Original set up:
    One placed PhotoShop file with transparency stacked upon the text frame.
    The image inside its holding frame is selected.
    The visibility of one of its layers depicting a second chair on the left side is switched off.
    2. The same setup in a different view:
    3. After running the script with the two additional lines of code:
    Using the PostScript method would do nearly the same plus adding a cross using the  area of the selected image.
    Uwe

  • 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.

  • How to remove corrupt image from iPhoto

    Somewhere in my photo library I have a photo that iPhoto really doesn't like! I want to know how to remove this image from my library, possibly by deleting it via Finder.
    When I scroll through my photos in iPhoto the software hangs momentarily, and then crashes completely, whenever it gets to this particular image. When I try to export my photos (for backup purposes) iPhoto always crashes when trying to export this same image.
    The problem has appeared with one of the recent updates to iPhoto, when I originally imported this image I could see and export the image just fine. The same issue is preventing me from migrating my photo library to the new Photos app - the import process that runs when I first launch Photos always crashes at the same point, presumably because of this same image file.
    I am unable to remove the image by deleting it via iPhoto because I can't get iPhoto to display the image without crashing, please can anyone suggest another way to get rid of it.

    I've been trying to post details from the crash report here, but the forum software tells me that the message contains 'an invalid character' - which character is invalid? Who knows...

  • How can I remove one image from a slideshow?

    Hi,
    I have several slideshows and want to remove one or two images.
    Is there a way to do this without deleting and rebuilding the slideshow ?
    Thanks in advance,
    christos

    Hi,
    I don't use thumbnails but I went ahead and turned them on.
    Perhaps due to the position of the slideshow only a few thumbnails appeared.
    I wasn't able to delete the image I wanted removed.
    I tried to remove the image from my assets, and that deleted the whole slide show.
    ( didn't save the changes )
    thanks,
    christos

  • I mostly work on Mac desktop, but use a Macbook Pro on trips. Due to limited HD space on the latter, I want to create a library of part of the images on the Mac, to be used on the Macbook. I do not however want to remove these images from the Mac library.

    I mostly work on Mac desktop, but use a Macbook Pro on trips. Due to limited HD space on the latter, I want to create a library of part of the images on the Mac, to be used on the Macbook. I do not however want to remove these images from the Mac library.

    Choose one or more Projects, and then use Export as New Library (from File).  The resulting export will be a fully functioning Aperture Library to either transfer and open on the Macbook Pro, or to Import into a library you already have on the MBP.
    Ernie

  • Remove JMenuBar area from JFrame

    hi there,
    I have an application with a JFrame undecorated and it has a JMenuBar.
    I add a JPanel in the JFrame, and I change the JMenuBar to JPanel,
    panel.add(Menu);
    setJMenuBar(Menu);the JMenuBar it visible into the JPanel
    but, in the JFrame I have the JMenuBar area blank at the TOP.
    How do I do to remove the JMenuBar area from JFrame.
    thanks.

    I am trying make a JFrame undecorated,
    I want create my own title bar, with my title message,
    my icons, etc.
    I found an image from a SAP Application frame
    here
    http://help.sap.com/saphelp_46c/helpdata/en/73/69ee7d55bb11d189680000e829fbbd/Image84.gif
    I want make a frame like this
    can you help me?
    thanks

  • Firefox Help Search Found 0 results for how do I remove an image from my apps toolbar area. It's not an app. it's a partial image from my desktop icons. It's like it partially opened and froze.

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/919974]]</blockquote>
    I have a partial image from one of my desktop icons stuck in the app bar of my firefox yahoo homepage and can't seem to remove it.

    Try this -
    <img src="assets/jpgs/Prodigy Logo Large 2014.jpg" width="180" height="180" alt="" style="display:block;">
    What you are seeing as whitespace is the space reserved for glyph descenders on any element that is rendered within a text box (i.e., an inline element). By making the image "display:block" you eliminate that space because a block element doesn't have descenders. If that works to your satisfaction then you can give the logo an id, and create a CSS selector containing that block style.

  • How do I remove all images from my Camera Roll?

    I connect my phone to an iMac and I cannot find an option to view and delete all of the Camera Roll images that have already been imported over many months.  There are 1,500 images in the camera roll and I want to remove them all. 
    I realize that you can 'delete images from device' after you import new photos into iPhoto.  These are older images that I don't want to delete one by one.
    THANK YOU FOR THE HELP!

    Open Photos, press the arrow button in the top right corner, tap all the photos you want to delete and press the delete button at the bottom.  (You still have to tap all of them; there's no "delete all" button.)

  • How do I remove custom images from Windows 8 lock screen

    I have a personal photos on the lock screen and account picture that I want to delete but cannot figure out how to remove them. I have read through dozens of solutions and there is no option to delete them I have deleted all skydrive data,
    removed my computer from the skydrive sync options, and looked in the c:\windows\Web\screen folder but still have no solution.
    How do I get rid of them?

    Hi,
    For the issue, the current user account picture (tile image) is stored in the hidden folder below.
    C:\Users\Public\Public Account Pictures\S-1-5-21.......(GUID for user account)
    The recent user account pictures used for your account are stored in the hidden folder below.
    C:\Users\(user-name)\AppData\Roaming\Microsoft\Windows\AccountPictures
    The default user account picture images are in the hidden system folder below.
    C:\ProgramData\Microsoft\Default Account Pictures
    I suggest you select a new picture to update your account picture.
    1.On your Start screen, click on your user tile at the top right corner, click on Change account picture.
    2.On the Personalize, then click "Browse" to select a new picture.
    Regards,
    Kelvin hsu
    TechNet Community Support

  • Removing Stacked Images from Book Browser

    How do you remove (delete) stacked images for the browser when you are making a book? With a single image I can just select the image and hit delete, but when I select an image that is in a stack it won't allow me to delete it from the browser.
    Just to be clear, I'm not trying to delete the images from my library, I'm just trying to remove them from the browser of a book project.
    thx.

    I did it by extracting from the stack, the image I wanted in the book. Then I could delete the remaining images in the stack.

Maybe you are looking for

  • Can we share selections from one Itunes account to another, or do we have to share the whole account and library?

    We have three computers, each with its own Itunes account, and each with its own library. There is overlap, but we don't each want all the same music. Can we share a selection here and there with one another, and how?

  • Backup of Macintosh HD won't mount

    I back up my entire system making an image with Disk Utility (as well as Time Machine). Time Machine doesn't back up Paralells VM files, so I went to grab it from my Disk Utility .dmg file that I made.  It mounts "Boot Camp" just fine, but refuses to

  • Create a 9.2.0.4.0 control file over 9.2.0.1.0 datafiles

    Hi. I had a Sun solaris cluster with Oracle 9.2.0.1. After a series of events the database won't start. Having in mind that a restauration of the cluster will take some time I want to quickly set up a temporary Red Hat 9.0 server with an oracle 9.2.0

  • Change Data Capture on a view

    I am trying to do change data capture on a view.When i start the journal i am getting error in the "create journal" step. BEGIN DBMS_CDC_PUBLISH.CREATE_CHANGE_TABLE( owner          => 'DMTRA_TEMPLATE', change_table_name     => 'J$BIEO_HYP_EXP_ORG_WEE

  • 10.4.8 - Wake-up from sleep issue: Workaround

    I eventually got rid of wake up from sleep issues on my PB G4, which I had systematically experienced since I upgraded to 10.4.8. Here is a workaround for those who have customized their EnergySaver: - the display and the computer must not go idle at