Quick question:  clear jlabel contents holding icon

Hi All,
I've been searching through the JLabel documentation and I've been trying to remove a JLabel's contents that displays an image.
// Here is the add code
JLabel1.setIcon(myImage);
How would I remove/clear this icon? I've tried JLabel1.removeAll(), JLabel1.remove(), and even tried JLabel1.getComponentCount() but the component count returned as 0.
There's gotta be an easy one liner for this. Please help. Thanks!

Here's what the API documentation for JLabel has to say about setIcon:
setIcon
public void setIcon(Icon icon)
Defines the icon this component will display. If the value of icon is null, nothing is displayed.
The default value of this property is null.
So the easy one-liner isJLabel1.setIcon(null);

Similar Messages

  • Pixel VS DPI - Need to have a quick question cleared up!

    Hello Adobe Forums!
    I would consider myself an experienced designer, but I have a question that might seem rather mundane. To be completely honest, I just think I have overthought/overanalyzed it to a point where I confused myself!
    In Photoshop, I have a 300 DPI psd image, that image size is 2"x1" and is 600x300px.
    Now, my question is: is there a way to reduce the DPI in an effort to increase the pixels?
    My goal is to have a larger amount of pixels at 72dpi for a web image. The theory makes sense in my head, but when put into practice, my image loses its quality. I need it to be sharp.
    Aside from all of this, if I do have to end up resampling, are there other programs that resample more effectively than Photoshop?
    Thanks in advance!

    Exactly. Web images have no PPI, only the pixel dimensions. Your image is 600px x 300px; ignore the 300 PPI, ignore the 2" x 1". Focus only on the 600px x 300px. When you use this image in a web layout, it will take up exactly 600px x 300px. Whether or not that size works for what you're trying to do is up to you, it is what it is. But the image is not 72 PPI or 300 PPI or any other PPI, since you're not printing it.
    In fact, even images destined for print don't have a specific PPI until you set the size at which they will be printed. Photoshop provides the PPI of the image based on a particular output size for convenience, but the only true measure of the resolution of a digital image are the pixel dimensions, period.
    Here's a short article I wrote for our customers w/ digital cameras, to explain digital resolution and print resolution:
    WHAT IS RESOLUTION?
    The resolution of a digital image is the number of pixels it  contains, plain and simple. If you open an image into Photoshop and go  to Image > Image Size, the top section of the dialog box shows you  the total number of pixels in your image. This is the actual resolution  of the image, independent of the size you plan to use it.
    For example, a photo taken with a Canon Digital Rebel XSi might have a  resolution of 4272 x 2848. This means there are 4272 pixels across, and  2848 pixels down, that make up the image.
    Most digital cameras are rated as a certain number of "megapixels." A  megapixel is one million pixels, and camera manufactures calculate the  megapixels by multiplying the maximum width by the maximum height that  their camera can capture. In the example above, the Digital Rebel XSi is  a 12 megapixel camera (4272 times 2848 = 12,166,656 pixels).
    HOW  BIG IS A PIXEL?
    A pixel has no size of its own, it is simply the smallest single  "unit" in a digital image. In fact, the word pixel derives from the term  "picture element." If you zoom in close enough in Photoshop you can see  all the individual pixels that make up an image. (In Photoshop CS4  there is also a pixel grid that you can enable to make it easier to  see.)
    SO  WHAT ABOUT PPI?
    You've probably heard a lot about pixels per inch (PPI) or dots per inch (DPI), but what does that actually mean?
    Pixels per inch is a relative measurement of resolution, that takes into account the size you're going to print the image. Now there's a  mouthful! Don't let that confuse you, though, it's actually really simple to calculate: take the total number of pixels and divide by the size you plan to use it.
    So for example, if you take that 4272 x 2848 image I mentioned  earlier and print it 10 inches wide, the resolution would be 427.2 PPI  (4272 divided by 10).
    For optimum print quality, we look for 300 PPI at print size, and a  similar calculation will tell you how big you can print your images.  Using that same image, take 4272 and divide by 300. The result is 14.24,  so you can print that image as large as 14.24" without the image  looking low-res or pixellated, or without doing any resampling in  Photoshop.
    Oh, and the proper unit of measurement for the resolution of a digital  image at a particular print size is PPI. The proper unit of measurement of the resolution of  an output device is DPI. The two are not synonymous nor  interchangeable -- images never contain dots, only pixels, and printers never print with pixels, only dots.
    OK,  SO YOU'RE SAYING RESOLUTION AND PPI ARE NOT THE SAME THING?
    Right. They're related, but not the same. The easy way to think about  this is that PPI is the "print resolution" of the image.
    Let's look at another example: say you have an image that is 1500  pixels x 1500 pixels, and you print it at 5" wide. 1500 divided by 5 is  300 PPI. If you print the same image at 10" wide, 1500 divided by 10 is  150 PPI. The print resolution has changed because you're using the image  at a much larger size, but the actual resolution of the image (1500 x  1500) has not changed.
    CAN'T  I JUST INCREASE THE RESOLUTION IN PHOTOSHOP?
    You can, but it's not the same as if the image had the correct  resolution to start with.
    If you ask Photoshop to increase the resolution of an image, it needs  to calculate how to add all those new pixels you're asking for. It uses  some pretty complex algorithms to do this, but it's still "inventing"  pixels that were never there. There is a limit to how much you can  artificially increase the resolution of an image without it being  visible (either as blurriness or jaggedness). And don't forget: a  low-resolution original doesn't contain as much detail as a high-res  image. Photoshop can only interpolate from the data that exists in the  file, so it won't magically add in all that missing detail.
    A good rule of thumb is if your image would be less than 225 PPI or  so at the size you want to use it, you would be better off retaking the  photo than upsampling in Photoshop. Anything less than that and it will  almost certainly appear low-res when printed, and you would see  artifacts if you upsample it.

  • 2 Quick Question

    Hello - I'm pretty new to Motion and have 2 quick questions:
    1) If you've got a bunch of keyframes on a timeline and want to make the entire sequence longer - is there a way to just pull the last frame out and have it automatically interpolate the keyframes in between so that it keeps the same timing and everything... it just makes the whole sequence take longer?
    2) On the same timeline with a bunch of keyframes, can you apply one long Interpolation (ala "Ease Out") to the entire thing from A-Z so that the whole sequence eases out rather than just keyframe to keyframe?
    Thanks!!
    Jason

    Heya,
    1. If you're asking if you have something like the "roving" keyframes in AE...well, kinda. Keyframes on footage, shapes, generators, particles, replicators—objects that create an image—don't seem to scale. But keyframes on secondary objects like behaviors and filters do scale.
    2. Very easy: go into the Keyframe Editor and click on the animation state icon/menu for the parameter you want to change. The icon/menu is the last column after the parameter's value in the left-hand side of the Keyframe Editor. If you pick an interpolation type in that menu, it applies it to all keyframes in that particular curve. It's also the same place where you can set the before/after extrapolation, like ping-pong, progressive, etc.

  • Oracle 10gR2 Dataguard quick question

    Hi -
    Just a quick question about Oracle 10gR2 Dataguard. I'm in the process of creating dataguard standby, which is running for few hours and could take few more hours because of the size and the standby's network latency, and i'm using OMS to create the DG. I'm in a situation now to create new tablespace(A) and also one more datafile to the existing tablespace(B).
    Question is: How would this new tablespace and the new datafile in the existing tablespace affect the DG standby which is about to finish in couple hours? Will the DG pickup the new changes from the primary? Or, will it be done with error from the mismatch of the number of files? The issue is that i can't wait for the standby creation to be done as the additional tablespace and datafile requirement is production critical, and should be added right away.
    note: standby_file_management is set to auto.
    Thanks for your response.
    regards.

    Your post is a bit vague, as OMS is an acronym for Oracle Management Server, which is a service only.
    If you would have stated you are using Database Control, or RMAN duplicate database, the picture would have been much clearer.
    Database Control uses rman duplicate database.
    Recovery is the mandatory implicit last step of this procedure to pick up all changes since you started the duplicate.
    One word of warning: Network latency is one thing to avoid like hell in a standby configuration.
    It might even slow down your production database.
    Sybrand Bakker
    Senior Oracle DBA

  • How to fix the " flashing question mark after the finder icon when starting up" withou an apple keyboard?

    Hi
    I am wondering How to fix the " flashing question mark after the finder icon when starting up" without an apple keyboard. I have 2 of those .7Ghz emacs so just wanna fix them
    Thx

    Hi,
    >I am using a wireless standard keyboard so maybe the emac doesn't regognise it
    Installation of driver software may be required. Do not expect any wireless device to automatically work with a Mac unless guaranteed to do so. In a case like this, use a wired USB keyboard (a PC keyboard should be OK) and a wired mouse to begin with.
    >I have installed Ubuntu 13.00 on the HDD from another computer.
    Is it a version for PowerPC?
    https://wiki.ubuntu.com/PowerPCFAQ
    https://wiki.ubuntu.com/PowerPCDownloads
    >a list of eMac hotkey's that can be used before OS boot from a standard Windows keyboard?
    Could the following article be of interest?
    http://support.microsoft.com/kb/970299
    If/when starting from a bootable CD, press and hold the C key.
    Jan

  • Copy Array Quick Question

    Just a quick question.
    Say I have an array A = [1,2,3,4,5]
    B = new int[5]
    I understand to copy the elements of A into B we could use a for loop.
    But can somebody explain to me why you can't just go B = A?
    Does this just cause B to point to A?
    So how do arrays work exactly? Is it like in C where each element is actually a pointer to the data, or does Java copy the data directly into the array element?

    Kayaman wrote:
    JT26 wrote:
    Array A=[1,2,3,4,5] ----> Here A is a reference variable which points to memory locations A[0],A[1],A[2],A[3],A[4] which could not be continueous.Actually no. What you have there is a syntax error. And please don't confuse people by talking about non continuous memory locations. That's simply wrong.And 100% irrelevant for the question at hand.
    >
    B = new int[5] -----> Here B is another reference variable points to an array which could hold 5 elemets.That is correct, basically.
    All the five element holders of B could be physically any where in the memory, thus copying the the elements is done via a for loop.No, Java is smart enough to store arrays sequentially in memory. And the smart way to copy large arrays is System.arrayCopy().Or java.util.Arrays.copyOf.

  • HT1752 I have a Power PC G4 tower and start up is not going to OS, I'm getting a question mark in a folder icon. What do I do?

    I have a Power PC G4 tower and start up is not going to OS, I'm getting a question mark in a folder icon. What do I do?

    Is OS X installed?
    Try a Startup Manager boot. Hold Option while starting.
    Try a Safe Mode boot. Hold Shift while starting.
    A flashing question mark appears when you start your Mac
    If the PRAM battery is old, the system can lose it's mind.
    Reset the PRAM.
    resetting the PRAM - Support - Apple

  • Report Generation Toolkit Error Quick Question

    Hi,
         I created the most awesome LabVIEW report ever at my desk using a trial version of the RGT and Office 2003.  I took this to my production machine and ")@#(&%(*#^%()^!!!"  The production machine has office 2007 and a fully licensed version of the RGT.  Both machines have LabVIEW 8.6.0.  I've read all the stuff about these errors and something about classes and dll's and whatnot's.  So my quick question, is:  Instead of matching the versions of Microsoft Office as recommended, can I just rewrite from scratch the VI that creates this world's most awesome LabVIEW report on the production machine to create the same effect? 
    Solved!
    Go to Solution.

    Hi 
    Quick Answer: Probably
    Slower answer: Microsoft changed a lot of things behind the scenes in Office 2007, but the Report Generation toolkit version 1.1.3 supports Office 2007 so you should be good to go. Depends on what functions are included in your VI. Liek the read me says "Several default settings in Microsoft Office 2007 differ slightly from previous versions. Reports you generate using Office 2007 might look different than reports you generate from other versions of Office because font sizes, cell sizes, and so on, differ."
    Best Regards
    David
    NISW

  • How do I get rid of the question mark in my FaceTime icon?

    I can't use the FaceTime on my phone. There is a question mark in the FaceTime icon. How do I get rid of it so that I can FaceTime?

    to answer that question we need more information. like did you verify that you have facetime enabled in your settings
    Also, what carrier are you using.

  • How can I change the apple ID on my iPhone to clear all contents and installation?

    I still have my iPhone 4s, Which I stopped using when the screen died. I bought a new iPhone 5s. Since, I've changed my Apple ID main e-mail address.
    Today I had the screen of the old 4s fixed. Now I want to clear all contents and installation so that I can sell it.
    Problem is, that it keeps asking me to verify my Apple ID with my old e-mail address, which obviously doesn't work.
    I've allready changed the Apple ID e-mail address in the Apple-ID area in settings. But this doesn't help.
    Does anyone know the way out of this?!?
    Thanks!

    http://support.apple.com/kb/HT5661

  • Two quick questions about Library after moving beginning on a new computer

    Hi there,
    I just moved from Windows to Mac, meaning I had to move my iTunes library from the old PC to my new MBA.
    Just a couple of quick questions.
    1. When I started iTunes on my new Mac, in the preferences I directed the media folder to the folder with all my itunes music/podcasts etc, and then I imported the Library XML file.  Is this incorrect? Should I have imported a different file? Should I have used the itl file instead? 
    If so, should I delete the library and start again?  (if this is the case, please suggest the best way of doing this without affecting my media)
    - a kind of sub-question to this one:  some of the media files arent showing up in the iTunes library, but they are in the media folder on the ext HDD.  Is there a way I can find out which ones havent been recognized by iTunes?  Whats the best way of getting them in to my library?
    2. Pretty much half of my podcasts have not been loaded in the new iTunes.  The ones that havent were ones that I subscribed to on my iPhone, whereas the ones that show up in iTunes were ones I downloaded from iTunes.  When I connect my iPhone and sync it with iTunes, will those podcasts show up in iTunes?  Or is there a risk that they will be deleted from my iPhone?
    Cheers,

    The .xml is lacking some information such as ratings, date added, and play count.  Using the .itl includes this information but cannot be imported using the method you did.
    A complete library is everything in the iTunes folder.  By using the method you did you left the artwork behind in the artwork folder on the other machine.
    Selecting the media folder in preferences does not get iTunes to recognize the media.  All it does is tell iTunes to start storing new media in that location.
    Using the method I outlined nothing will be missed (with the exception of WMA) because you aren't rebuilding your library, you are using the one that already exists.
    You don't have to re-copy everything as long as you get the stuff you missed and re-assemble it all as it was before except not on the Mac.
    What are the iTunes library files? - http://support.apple.com/kb/HT1660
    More on iTunes library files and what they do - http://en.wikipedia.org/wiki/ITunes#Media_management
    What are all those iTunes files? - http://www.macworld.com/article/139974/2009/04/itunes_files.html
    Where are my iTunes files located? - http://support.apple.com/kb/ht1391

  • Quick question re select-options

    Hi
    I am relatively new to ABAP but have a quick question:
    I need to create a select-options which does the following:
    1. Allows ONLY "equals" signs
    2. Disallows intervals
    3. Disallows the use of ranges in the multiple selection box.
    4. Allows multiple individual selections.
    I can achieve most using the following:
    select-options s_knvh for knvh-kunnr no intervals.
    However, this still allows ranges using the multiple selection box, and also allows the "not equal to" option.
    Adding the "no-extension" syntax simply removes my ability to use multiple individual entries.
    Any ideas?
    Thanks
    Jon

    Use this FM.
    SELECT_OPTIONS_RESTRICT

  • Need to function module to clear Subscreen contents

    Hi.
    can anyone say Function module which clears the contents of Subscreen when navigated from subscreen to subscreen.
    MY Problem:
    i have 6 subscreen.(A,B,C,D,E,F) each subscreen has 100 checkboxes.
    i checked some checkboxes of subscreen A. And navigated to subscreen B. And again navigated back to subscreen A.
    I found all the checkboxes what i checked before are checked. I want them to be unchecked(screen not refreshed), when i come back to that subscreen.
    Any Function module avaliable to refresh screen contents.
    Help me.

    Don't think so. I am affraid you will have to clear all checkboxes one by one. Anyhow you can use field symbols to address them dynamically and clear their content.
    "suppose you have checkboxes ch_01, ch_02 ... ch99
    field-symbols <checkbox> type any.
    data: g_checkbox_name type string.
    data: n_index(2) type n.
    do 99 times.
      n_index = sy-index.
      concatenate 'CH_' n_index into  g_checkbox_name.
      assign (g_checkbox_name) to <checkbox>.
      check sy-subrc = 0.
       "cleat the content of subsequent checkboxes
       clear <checkbox>.
    enddo.
    Regards
    Marcin

  • A quick question about WebDynpro SLD and R/3 with concurrent users

    Hello ,
    I have a very quick question about Webdynpros and SLD connecting to an R/3 system, when you configure a webdynpro to connect to an R/3 system using SLD, you configure a user name and password from the R/3  for the SLD to use. What I would like to know is when I have concurrent users of my webdynpro, how can I know what one user did in R/3 and what another user did? Is there a way for the users of the web dynpro to use their R/3 credentials so SLD can access the R/3? Like dynamically configuring the SLD for each user?
    - I would like to avoid leaving their their passwords open in the code ( configuring two variable to get the users username and password and use these variables as JCO username and password )
    Thanks Ubergeeks,
    Guy

    Hi Guy
    You will have to use Single Sign On to achieve this. In the destination you have defined to connect to R/3 , there is an option to 'useSSO' instead of userid and password. This will ensure that calls to R/3 will be with the userid that has logged into WAS. You wont need to pass any passwords because  a login ticket is generated from WAS and passed on to R/3. The userid is derived from this ticket.
    For this to happen you will have to maintain a trust relation ship between R/3 and your WAS ,there is detailed documentation of this in help files. Configuration is very straight forward and is easy to perform
    Regards
    Pran

  • QUICK QUESTION ABOUT PORTS

    Hi, I have a quick question about port forwarding/mapping. My question, lets say I am running MSN messenger, who's ports are 6880-6900. But lets say I am running a torrent application or something else that requires those ports. If both applications were running at the same time, would this cause interference with them on the same ports or now. Thanks
    Nathan

    Normally, only one application can listen to a specific port number at a time. If MSN is grabbing those 21 ports then your torrent app won't be able to run.
    However, most apps don't work that way - even if they use multiple ports, they don't use them all at the same time, so MSN might use 6880 when it starts up, leaving the others open for other applications to use if needed.
    Only experimentation will answer that one.

Maybe you are looking for

  • Photoshop CS4 not opening & Wacom Cintiq 20WSX driver problem

    Hello, I have been using Photoshop CS4 for quite sometime now with no issues. I have just started using a Wacom Cintiq 20WSX and installed all the necessary drivers and now Photoshop will not open (I have seen other threads relating to Intuos tablets

  • How to connect my cannon mx430

    there anybody knows how to connect canon mx430

  • AddAppUser can't associate more than 2 groups

    Has anyone experienced this with this new AXL API on CUCM 7.0? When trying to associate more than 2 groups with an application user, AXL responds with: Could not insert new row - duplicate value in a UNIQUE INDEX column the original request is: <axl:

  • Difference between Abort_Query and Exit_Form

    Hi all, I'm using developer 6i in C/S environment. I have the follwing code: If :system.mode = 'ENTER_QUERY' then do_key('ABORT_QUERY'); else do_key('CLEAR_FORM'); end; This has a strange behaviour. When the form is in 'ENTER_QUERY' mode the abort_qu

  • ESS/XSS Web Dynpro SCA import in CMS to view/modify Web Dynpro Source Code

    I am having problems importing ESS/XSS Web Dynpro related SCA's into CMS. Following steps were followed 1. Download following files from SAP service marketplace. BPERP4ESS0_0-10003146.sca ESS09_0-10002965.zip ( This file shows as SCA in the download