Netbeans refuses to show the jpg...

Hi!
I do not know which forum is good for this problem, so I try this one...
The code below works well when executed by foot (...java showPic...).
In the NetBeans 3.6 the frame refuses to show the pic, only an emty frame!
Is it a bug?
If anyone can help, it would be very nice ;-)
import java.awt.*;
import java.awt.event.*;
public class showPic extends Frame {
Image pic;
public showPic() {
addWindowListener( new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
pic = getToolkit().getImage("lemmer.jpg");
setSize(200,100);
setVisible(true);
public void paint(Graphics g) {
if (pic != null) {
g.drawImage(pic,60,20,this);
public static void main( String[] args ) {
new showPic();
}

Unfortunatly It didn't work for me
I have the following:
ImageIcon image1 = new ImageIcon("images/button1.gif");I can run the application, but I can't view the image
Changing it to :
ImageIcon image1 = new ImageIcon(getClass().getResource("images/button1.gif"));Now I can compile it correctly, but I can't execute ( exception in thread "main") ! Why?
By the way, sometimes when I compile in NetBeans I got Errors while compiling (FileName). In this case I open the command line and run javac (and it works fine)!!! WHY?

Similar Messages

  • Finder issues and Get Info refusing to show the number of files on items on the main hard drive.

    I am having finder issues. Mostly on the main hard drive. It takes ages to find things and I get the spinning wheel every time I open a folder.
    So I moved all of my files to a external drive.  When I had finished transfering I hit get info on the files on the external drive and on the same folder on the main drive.  To ensure that it has copied over all the files.  Because it was acting up and not copying all the files.
    Get Info refuses to show the number of files within the folders on the main hard drive. It hasppily tells me everything on any of the external drives.
    I have reset, the imac.  I have re indexed 3 times.  I have deleted the finder plist files.  I have reset finder using terminal commands. I have moved nearly everything off the main hard drive. But nothing is working.
    Can anyone offer any suggestions as to what could be causing my finder and get info issues.
    Any help wpuld be appreciated.
    Running Mountain Lion on a late 2009 Imac

    Some of your user files (not system files) have incorrect permissions or are locked. This procedure will unlock those files and reset their ownership, permissions, and access controls to the default. If you've intentionally set special values for those attributes, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it, but you do need to follow the instructions below.
    Back up all data.
    Step 1
    If you have more than one user, and the one in question is not an administrator, then go to Step 2.
    Enter the following command in the Terminal window in the same way as before (triple-click, copy, and paste):
    sudo find ~ $TMPDIR.. -exec chflags nouchg,nouappnd,noschg,nosappnd {} + -exec chown $UID {} + -exec chmod +rw {} + -exec chmod -N {} + -type d -exec chmod +x {} + 2>&-
    This time you'll be prompted for your login password, which won't be displayed when you type it. Type carefully and then press return. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command may take several minutes to run, depending on how many files you have. Wait for a new line ending in a dollar sign ($) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1, if you prefer not to take it, or if it doesn't solve the problem.
    Start up in Recovery mode. When the OS X Utilities screen appears, select
              Utilities ▹ Terminal
    from the menu bar. A Terminal window will open. In that window, type this:
    res
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not going to reset a password.
    Select your startup volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button
    Select
               ▹ Restart
    from the menu bar.

  • My Apple TV all of a sudden refuses to show my movies from my MacBook and says it needs to set time network. What is that?

    My Apple TV all of a sudden refuses to show the movies from my MacBook and says it needs to set time network. What is that?

    Welcome to the Apple Community.
    The Apple TV should set it's time automatically from the network time server, if it isn't doing this try restarting the Apple TV by removing ALL the cables for a 30 seconds, if this fails try resetting or restoring it.

  • Since the 4.0.1 update the first Firefox window I open refuses to open tabs, only new windows, and all refuse to show my bookmarks toolbar. All Sync settings and account seem lost.

    Since the update the first Firefox window I open refuses to open tabs, only new windows, and all refuse to show my bookmarks toolbar. All Sync settings and account seem lost.

    G'day again, I've also lost the option of a 'Stop loading' or 'Refresh' button.

  • How can I add a Progress bar to show the "render to JPG" progress?

    Hi everyone, I have a button which renders my component to
    JPG.
    How can I attach a progress bar to show the progress of the
    rendering?
    <mx:Button label="render" click="renderasJPEG ()"/>
    public function renderasJPEG( ):void
    convertToImage( component001, new JPEGEncoder( 100));
    private function convertToImage( object:IUICompon ent,
    encoder:IImageEncod er):void
    var base64string: String = ImageSnapshot. encodeImageAsBas
    e64(
    ImageSnapshot. captureImage( object, 72, encoder));
    var variables:URLVariab les = new URLVariables( );
    variables.encoded = base64string;
    variables.type = "jpeg";
    var request:URLRequest = new URLRequest(" script_saveasima
    ge.php");
    request.method = "POST";
    request.data = variables;
    navigateToURL( request, "_blank");
    Thanks in advance.

    Hi,
    I would have thrown a prompt to the user in the renderasJpeg
    function and removed it in last line of convertToImage function.
    Isn't this what you want?
    Hope this helps.

  • When I download photos from a flash drive,everything is fine and they show in Events and Pictures, but when I click on the individual pic I get an error message saying that it cannot locate the JPG. Any thoughts?

    When I download photos from a flash drive,everything is fine and they show in Events and Pictures, but when I click on the individual pic I get an error message saying that it cannot locate the JPG. Any thoughts?

    It sounds like your iPhoto Advanced preferences are set to not copy photos during import, i.e. a Referenced library:
    Check your Advanced preferences to see if that's the case. If it is the best solution would be to select the checkbox to copy the photos and reimport the photos from the flash drive.  Then check the new import. It it was OK you can delete the previous event with the "missing" photos.
    OT

  • The wifi on my iphone 4s is not working, i have gone to the settings and tried to swicth it on but it shows the gray slide and refuse to turn on, what should i do about this

    product name - iPhone 4s
    memory - 64 GB
    storage capacity - 56.6 GB
    version nos - 8.1.1(12B435)
    the WiFi on my iPhone 4s is not working, i have gone to the settings and tried to switch it on but it shows the gray slide and refuse to turn on, what should i do about this.

    iOS: Wi-Fi settings grayed out or dim - Apple Support

  • Problem: The fade in button/tab refuses to show up

    I have a four minute slideshow using two different songs. When the second half with the new song starts up, it is too abruptly loud and I want to do a fade In. Problem is, whereas the grey fade out button appears for at the end of the last clip with the ending of the first song, the grey fade in button refuses to appear at the beginning of the second half with the second song.
    I had the same problem with trying to increase the volume of the second half with the new song. The volume adjust handles refuse to show up on the second half of the slideshow with the new song.
    Do you have a fix for this?
    -L

    Hello Matthew,
    Related to thread, our custom viewer app has a similar problem that only the latest free issue (published via folio builder website) is appeared, and 3 retail issues (published via folio builder) and other 3 retail issues (published via pre-release content bundler) are disappeared. And purchased 2 retail issues (published via prerelease content bundler) are appeared when logged in with the apple ID used for those 2 retail issued. Please look at my question on the forum 'http://forums.adobe.com/thread/898282?tstart=0'
    I've emailed (through the private message tool here) you our contact information including our Gold support contract number.
    Please help us to solve this urgent issue, still affecting our magazine app.
    Thank you
    Yoonho Choi
    LPMag Korea _ Ahn-graphics Ltd.
    Message was edited by: [email protected]

  • After changing my graphic card to an ASUS Strix GT 970, Photoshop CS6 opens the JPG files without show them on the screen

    After changing my graphic card to an ASUS Strix GT 970, Photoshop opens the JPG files without show them on the screen

    Try turning off GPU support in your Photoshop's preferences performance section.  Also check that you have installed the latest device driver installed for your GT 970 adapter and that all CS6 updates are installed... Your CS6 should be version 13.0.1.3....

  • Application shows - "The server refused the connection " when I click on project from ATG BCC and then layout

      Hi,
          Application shows - "The server refused the connection " when I click on project from ATG BCC and then layout. Can you please tell me the cause of the error and the log file where i need to debug. We have deployed on Weblogic Server.
    Thanks

    Hi,
    You can see ATG server log, located at ATGXXX/home/servers/yourPublishingServer/logs, and you can see your wwblogic server log.
    In WebLogic, the logs are located at domains/your_domain/server/yourPublishingServer/logs.
    Check the logs and then return with it, so we can help you.
    Hope it helps.

  • I was upgrading my iOS last night but when I checked to see the progress ,the home page refused to show. After d apple icon comes on the screen immediately changes to show the iTunes icon with a charging port cable

    I was upgrading my iOS last night but when I checked to see the progress ,the home page refused to show. After d apple icon comes on the screen immediately changes to show the iTunes icon with a charging port cable. What should I do?

    That means that you have to connect your iPad to your computer and you need to use iTunes to restore the iOS. Software. Read this for the instructions.
    iTunes: Restoring iOS software - Support - Apple

  • Why is it that when I set the preference to always show the tab bar, it refuses to stay checked after I quit Firefox and restart it?

    Using Mac OSX10.6.7 and FF 4.0.1, I'm having a problem with the preference to always show the tab bar. I want it to always show. I check this in the Preferences under the "tab" window, and everything is fine until I quit FF and when I restart FF the tab bar is gone again. I go into preferences, and that option is now unchecked. How can I fix this so that my preference is saved?

    That hasn't helped the last ten times I tried. I posted before. I deleted the preferences file, I tried changing the preferences file, I went into about:config and changed the autoHide preference there. No dice. Firefox is not saving my preference for that one thing.

  • XMLDataSet Refuses To Show Me The Data In IE7

    Hi, I tried to create a test application that shows the
    contents of a directory, using Spry + HTML + PHP.
    I run the following page (see end of post) from the test
    server (it's all Hand coded - no DW suport for spry, no sites
    defined - nothing).
    In FF2 everything works like a charm. In IE7, though, the
    table and generaly the contents inside <div
    spry:state="ready"> will not show what so ever, and only what's
    inside <div spry:state="loading"> is shown ...
    The src to the scripts is ok, and they load fine. The xml
    document is validated ok (I loaded it using MSXML2.DOMDocument in
    IE7 and it parsed ok).
    I don't have the slightest idea as what's wrong with it in
    IE7. Can someone help ?
    Thanks
    P.S.: I've tried to delete the table and leave the
    spry:state="ready" region empty with a text message. Still no
    results.
    ______________________ PAGE CODE ______________________
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml"
    xmlns:spry="
    http://ns.adobe.com/spry">
    <head>
    <title>Directory Listing</title>
    <meta http-equiv="content-type" content="text/html;
    charset=utf-8" />
    <link rel="stylesheet" media="all" type="text/css"
    href="../../styles.css" />
    <script language="javascript" type="text/javascript"
    src="../../_spry/includes/xpath.js"></script>
    <script language="javascript" type="text/javascript"
    src="../../_spry/includes/SpryData.js"></script>
    <script language="javascript" type="text/javascript">
    <!--
    var dsFileList = new Spry.Data.XMLDataSet(
    "./get.directory.sck.php", "directory/entry" , {sortOnLoad :
    "text()"} );
    //-->
    </script>
    </head>
    <body>
    <div spry:region="dsFileList">
    <div spry:state="loading"><div class="WindowFrame
    Loading">Loading</div></div>
    <div spry:state="failed"><div class="WindowFrame
    Error">Error</div></div>
    <div spry:state="ready">
    <table class="TabularList" cellpadding="2"
    cellspacing="1">
    <tr class="Headers">
    <th style="width: 30px"> </th>
    <th spry:sort="text()">File Name</th>
    <th style="width: 100px"
    spry:sort="@type">Type</th>
    <th style="width: 100px" spry:sort="@size">File
    Size</th>
    </tr>
    <tr class="Row" spry:repeat="dsFileList"
    spry:hover="RowHover" spry:select="RowSelect">
    <td><img src="../../images/{@icon}_ico.gif"
    class="FileIcon" /></td>
    <td>{entry}</td>
    <td>{@type}</td>
    <td>{@size}</td>
    </tr>
    </table>
    </div>
    </div>
    </body>
    </html>

    Don Hi,
    I understand what you say... I've forced
    header("Content-type: text/xml; charset=utf-8") in the php page /
    xml provider and added a <?xml .... header for that particular
    reason.
    When I open the xml data provider directly from IE7 it shows
    (highlights and acts) as xml file. When I create an
    ActiveXObject("MSXML2.DOMDocument") and load the provider with it
    (xmlDoc.load()) it's loaded and parses fine (I imagine that you use
    this object in spry & IE). I don't think it's the xml, but I
    could be wrong.
    The problem happens when it's fed to the XMLDataSet and only
    in IE7. The dataset shows the contents of the spry:state="loading".
    Also, the spry file I've downloaded is spry_p1_5_051707.zip.
    I've downloaded it 3-4 days ago so it must be the most recent
    version.
    I've set up a public version of the script at
    http://b-sides.quadelectra.com/spry_filelistscript/app/pages/files/
    in order to give you an idea....
    Something i forgot to mention: The examples that go with the
    SDK work fine (with IE & FF). It could be that I'm doing
    something wrong. On the other hand I ve checked, rechecked and
    re-rechecked everything and I can't seem to find any bugs.
    Thanks.

  • ICloud refuses to show me the emails!!!

    I sent a test mail from my Gmail account.
    iClould shows one unread mail message in the sidebar but I cannot see anything on the reading pane!!!
    I doubt apple hires guys from microsoft!!!!!
    Is this the way Mr. Cook wants to "continue doing" what Steve jobs wanted to do??

    Don Hi,
    I understand what you say... I've forced
    header("Content-type: text/xml; charset=utf-8") in the php page /
    xml provider and added a <?xml .... header for that particular
    reason.
    When I open the xml data provider directly from IE7 it shows
    (highlights and acts) as xml file. When I create an
    ActiveXObject("MSXML2.DOMDocument") and load the provider with it
    (xmlDoc.load()) it's loaded and parses fine (I imagine that you use
    this object in spry & IE). I don't think it's the xml, but I
    could be wrong.
    The problem happens when it's fed to the XMLDataSet and only
    in IE7. The dataset shows the contents of the spry:state="loading".
    Also, the spry file I've downloaded is spry_p1_5_051707.zip.
    I've downloaded it 3-4 days ago so it must be the most recent
    version.
    I've set up a public version of the script at
    http://b-sides.quadelectra.com/spry_filelistscript/app/pages/files/
    in order to give you an idea....
    Something i forgot to mention: The examples that go with the
    SDK work fine (with IE & FF). It could be that I'm doing
    something wrong. On the other hand I ve checked, rechecked and
    re-rechecked everything and I can't seem to find any bugs.
    Thanks.

  • HT4060 my i pad show the charging green light .it works properly .however it was 37% battery charged and i tried to charge it .but it refused to charge .pls help .i had the same problem a while ago and then suddenly it charged on its on .pls help

    my i pad is not charging ,however it shows the green light and charging signs
    .before i had this problem, then it started charging on its own . now i was abroad it was 37% charged .was going to charge it for the journey and it stopped charging again .but it works excellent except for the charging .it still works but i am not using it now .just left it on the charger .the green light and the battery sign shows its charging ,but the i pad now is 35% the battery power .pls help .i cant aford another pad .i am broke and i am so much used to it

    It may just be giving you false battery info. Unless it actually dies prematurely, Its just a software error. I would recommend restoring. http://support.apple.com/kb/ht1414

Maybe you are looking for

  • How to create 3d effect in adobe photoshop 6

    I cannot find the option to convert 2d images to 3d effect in adoble photoshop 6 please tell how to do this. I ask it in a website here

  • Material not defined in the sales org

    1 While creating a sales order in VA01 , i am trying to search for a material which i had created ,but that material is not being displayed . 2 when i select any of the available ,materials there is a error message displayed Material [ ] is not defin

  • IWork apps won't launch

    I recently restored my system from a Carbon Copy Cloner backup and everything works fine again, except that my iWork apps will not launch.  I double click on the app (Keynote 6.2.2, Numbers 3.2.2, or Pages 5.2.2), and the icon in the dock bounces ind

  • Should modifying an email address policy also remove e-Mail addresses from user profiles?

    I am noticing that when I modify our standard corporate email address policy in Exchange 2010, via the EMC, I am able to apply the changes to all the email enabled account, groups, resources, etc.   However, if I remove one of the email addressing fo

  • Open hhtps with a client certificate

    Hi: How do I open a https connection with a specific client certificate? I mean; If I have a X509Certificate, how do I open a connection with a ssl server by code? Client certificate can be different, It deppends of user. Thanks Edited by: MrViSiOn o