Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

[java] Displaying an icon

This topic is 5948 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am having a problem with displaying an icon and am not sure if it''s just my IDE. I''m using Forte for Java CE. I declare the icon like this: Icon bug = new ImageIcon("bug1.gif"); and then I display it using a JLabel: label = new JLabel("Label Text", bug); or label = new JLabel(); label.setIcon(bug); Everything compiles fine and the text for the Labels display fine, but for some reason the image won''t display. Any suggestions would be appreciated.

Share this post


Link to post
Share on other sites
Advertisement
That''s a problem with Forte/netbeans IDEs. You''ll need to mess around with the project options(I can''t remember which one right now). Alternately, you could just run the program from command line (i.e. enter java class name) at the command prompt. That would work.

Share this post


Link to post
Share on other sites
Thank you for the help. I just tried running it from the command line and it works fine. I should have done that sooner. Are there any recommendations for a good Java IDE? I also have MS J++ but haven''t used it yet. Is Visual J++ good? I find that Sun''s Forte for Java runs quite slow and am looking to switch.

Thank you.

Share this post


Link to post
Share on other sites
I use VJ++ and have never had any copmatability problems, or gripes for that matter. Although I should warn you that if you do use VJ++ don''t use any of the MFC classes they provdie.. Otherwise your app or applet will only run on an MS machine.

-The cowboys have a way of trussing up a steer or a pugnacious bronco
which fixes the brute so that it can neither move nor think. This is the
hog-tie, and it is what Euclid did to geometry.

-War doesn''t determine who is right, war determines who is left.

Share this post


Link to post
Share on other sites
Ah, found it. Go to tools, options, execution, external execution, Info (look at one of the tabs), and set the working directory to point to your working directory. That''ll make it work.



My advice is stay away from MSVJ++. Why? Its stuck in Java 1.1. Most of the world has now moved to Java 1.3.x, and we''re expecting JDK 1.4.

Share this post


Link to post
Share on other sites
NuffSaid: That depends on whether or not you want your audience to have to get a plugin or a newer runtime environment. If those issues don''t bother you SHsing, then I would do as NuffSaid suggest and get a different IDE. Although already have VJ++ on hand is a bonus, then again I am pretty lazy.

-The cowboys have a way of trussing up a steer or a pugnacious bronco
which fixes the brute so that it can neither move nor think. This is the
hog-tie, and it is what Euclid did to geometry.

-War doesn''t determine who is right, war determines who is left.

Share this post


Link to post
Share on other sites
WinXP doesn''t come with the MS JVM, so they''re going to have to download a new plug-in anyway. I''d rather that plug-in be the latest JRE, rather than one that is 4 years old.

Besides, if using a plug-in worried me, I''ll be using C++ (with a x-platform GUI library)

Share this post


Link to post
Share on other sites
That''s assuming everyone in the world has win xp, which is definiately not the lowest common denominator, or plans on upgrading to it... And eventually they just might. But that eventually will be a long way off I bet. Just out of curioustity does anyone know what kind of a user base xp has already? I''m not talk pc boxes in production that have an OEM version installed. I mean how many home users are using XP any numbers and projections? I personally will not upgrade to XP, but my opinion is usually worth squat. What is everyones thoughts on this? I might need to post this quesiton in it''s own thread..

-The cowboys have a way of trussing up a steer or a pugnacious bronco
which fixes the brute so that it can neither move nor think. This is the
hog-tie, and it is what Euclid did to geometry.

-War doesn''t determine who is right, war determines who is left.

Share this post


Link to post
Share on other sites
No, but seeing as the WinXP Java issue is due to the infamous lawsuit between MS and Sun, its most probable that future versions of Windows won''t come with a JVM.

Other OSes don''t use JDK1.1 either. They don''t come Java enabled, so they''ll end up downloading the JRE anyway. So, my point still stands.

Share this post


Link to post
Share on other sites
quote:
Original post by SHsing
Thank you for the help. I just tried running it from the command line and it works fine. I should have done that sooner. Are there any recommendations for a good Java IDE? I also have MS J++ but haven''t used it yet. Is Visual J++ good? I find that Sun''s Forte for Java runs quite slow and am looking to switch.

Thank you.


The new JBuilder 6 is awesome - but it''s a tad expensive.
Most of the time I use a cheap shareware IDE called JCreator (www.jcreator.com). Although, if you doing a lot of Swing/GUI work it doesn''t have a GUI editor (most of the stuff I do is backend services etc.).
As I understand it you can''t switch the JDK with Visual J++ can you ?





Slightly shrimpy smell == unsafe breadbin

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!