Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Java application works fine in IDE but not in windows

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Java application works fine in IDE but not in windows

    Hi

    I hope you can help me:

    I have a Java project that works fine in IDE but not in windows, the application shows a screen using javax.swing.JDesktopPane() when clicking in a tree node, I have several nodes and all of them work fine except the last one I add recently, when in IDE it is ok, when I double click the .jar everything works fine except the last that does not shows and no errors messages are displayed, the program stops in the next code:

    JLabel itmx = new JLabel();
    itmx.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imgs/Tx.jpg")));
    ventana.getContentPane().add(itmx);
    itmx.setBounds(400, 10, 160, 50);

    Tx.jpg (3,402 bytes) could be open with “Paint”, and is in C:\...\build\classes\imgs and in C:\...\src\imgs
    NetBeans 6.8.
    Windows XP SP3.
    Cleaned and building several times after each edition.

    Manifest.mf:
    Manifest-Version: 1.0
    X-COMMENT: Main-Class will be added automatically by build

    Thank you in advance

    Sincerely
    Adolfo Ponce


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Java application works fine in IDE but not in windows

    the program stops in the next code
    How do you know where the program stops?

  3. #3
    Junior Member
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Java application works fine in IDE but not in windows

    Tahnk you for your time Norm:

    I put some "flags" like
    JOptionPane.showMessageDialog(ventana,"step 1","classname",JOptionPane.INFORMATION_MESSAGE) ;
    all over the code, besides when I comment this code the .jar works fine (no image Tx.jpg showed, of course) but in NetBeans works well always.

    Any Idea?



    , no displays of Tx.jpg of course

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Java application works fine in IDE but not in windows

    How can I have any idea? I have seen no code that demonstrates the problem.

  5. #5
    Junior Member
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Java application works fine in IDE but not in windows

    I'm not lying Norm, I’m sorry I bothered you, I am just looking for some help from someone who has experienced a similar problem or someone with enough experience to give sensible directions to solve the problem, I am a novice in java, I do not know how can I demonstrate the problem, it simple appears that the thread stops or cycles when the image file is loaded, the program does not hang up, I have even tried other image files that I used in others screens, when I click the node all the “flags” appear until it reaches this code and then… nothing, and this only when executing the .jar.

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Java application works fine in IDE but not in windows

    There are many ways for programs to not do what you want them to do. I have no idea what your program is doing and can not suggest anything except to try debugging the code by adding printlns to show what the code is doing.

Similar Threads

  1. LDAP Sort 2 attributes returns NO results. Works fine if sorted on one.
    By funnyguy in forum What's Wrong With My Code?
    Replies: 0
    Last Post: December 30th, 2011, 01:31 AM
  2. Program works fine but with friend it doesn't work
    By Rizza in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 1st, 2011, 01:20 PM
  3. It works!!! eureka!!! Java...Day 12.
    By Spidey1980 in forum What's Wrong With My Code?
    Replies: 18
    Last Post: August 18th, 2011, 09:41 PM
  4. Windows Bluetooth Application
    By SarahVeni in forum Java Theory & Questions
    Replies: 1
    Last Post: July 1st, 2011, 01:15 AM
  5. How database connection pooling works in a application
    By JayVirk in forum JDBC & Databases
    Replies: 0
    Last Post: October 10th, 2009, 07:14 AM