Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / Eclipse on: 2004-12-01 19:19:40
I don't know how much this board is used as a knowledgebase, but this is the kind of thing I want to find if I were to search for Eclipse, or set-up, or IDE...

Quote
I think now's a good time for me to post up my "Getting Started with Eclipse" tutorial. Explains the hardest part of Eclipse - the first 5 minutes of setting things up, complete with a good amount of illustrations.

I wrote it for some people totally new to Java so keep that in mind when you see me explain something that any of us would take for granted.

http://zelda.acidblue.net/Eclipse/

p.s. Looks like you missed the most important step of all. Make sure that you are in the Java perspective, otherwise nothing will work at all, nothing. Check the tutorial to see where that actually is.


I was using NetBeans, and now that I've set up Eclipse properly, I think that's it's much better (especially when being able to just click to solve problems).

One thing that could be added to the tutorial is an explanation of how to actually do the "run" part.  I was able to figure it out, but I was also pretty worried that I was going to screw something up along the way.
2  Game Development / Newbie & Debugging Questions / Re: Really basic image loading question on: 2004-12-01 18:04:14
Quote
Before you do that though, could you take a full snapshot of Eclipse and post it here?


I'll try getting another copy and see if that works... Thanks for all the help!

Here's the pic - I'm assuming that's what you mean by snapshot:
http://img16.exs.cx/img16/2606/eclipse-screen.jpg
3  Game Development / Newbie & Debugging Questions / Re: Really basic image loading question on: 2004-12-01 14:18:49
Okay, I checked out the tutorial, and it looks very helpful.  But it still doesn't fix the fact that I don't have a Java Perspective.  I'm not kidding, and I'm not an idiot.  I went to Window->Open Perspective (which I'd done before, trust me, just because I'm new doesn't mean I'm stupid) ... there is no Java Perspective.

I've got:
CVS Repository Exploring
Debug
Resource (Default)
Team Synchronizing

Did I screw something up when I "installed" Eclipse?  Did I get an incomplete version or something?
4  Game Development / Newbie & Debugging Questions / Re: Really basic image loading question on: 2004-11-30 21:12:51
You're right about the importing!  I'd checked the API before, but somehow ended up with the wrong packages... I got it right now! Thanks!

As for Eclipse though... When I go to create a new file, there is no option to make a new Class - I only have File, Folder, and Project as choices.  In addition, there doesn't appear to be a "java" editor... if I use the default editor, it opens the file in NetBeans. If I use the text editor, it doesn't give me any color coding. I can live with that, but ... I don't have a running man, nor a Java Perspective.  I'm using: Version: 3.0.1, Build id: 200409161125, which I just downloaded yesterday (or maybe the day before).  I can select Run->External Tools to get "Run As", but that doesn't expand to anything (like, say, Applet, or Java application...)  Is it possible I'm missing a plug-in or something?  Doesn't seem like Eclipse is doing themselves any favors in the marketing department...

5  Game Development / Newbie & Debugging Questions / Re: Really basic image loading question on: 2004-11-30 18:19:45
Quote
http://www.eclipse.org

It'll figure out your errors and fix them for you! Smiley
It's really handy because it'll tell you where the error is, and exactly how to fix it, and will even let you click on the desired solution to have it execute for you.  If you don't want to use this handy IDE, perhaps you could give us the full error message and we can better address the problem


Funny you mention that... I actually have Eclipse, as well as NetBeans (just got v4b2).  I find that NetBeans is easier to use as a newb... I tried Eclipse and couldn't figure out how to build my file.  With NetBeans you just press a button and it goes.  I'm assuming this means that Eclipse is more powerful (apps that are harder to figure out are usually more powerful it seems), but for now, I'm sticking with NetBeans.  

As far as the errors I'm generating, they come straight from the code that woogley posted.  I like the simplicity of the code, and it seems like it should work, but here's what's happening...

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
Compiling 1 source file to C:\aliasGame\build\classes
C:\aliasGame\src\AliasGame.java:129: cannot find symbol
symbol  : class URL
location: class src.AliasGame
        return ImageIO.read(new URL(path).openStream());
C:\aliasGame\src\AliasGame.java:131: cannot find symbol
symbol  : class IOException
location: class src.AliasGame
        catch (IOException e) {
C:\aliasGame\src\AliasGame.java:134: cannot find symbol
symbol  : class MalformedURLException
location: class src.AliasGame
        catch (MalformedURLException e) {
Note: C:\aliasGame\src\AliasGame.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors
BUILD FAILED (total time: 2 seconds)


The lines it references are straight from the code I copied and pasted.  Like I said, I've tried importing other stuff to help find the symbols, but it hasn't worked yet.
6  Game Development / Newbie & Debugging Questions / Re: Really basic image loading question on: 2004-11-30 14:07:26
Quote
unfortunately an Image loaded from Toolkit will not be loaded as soon as you call it. I suggest you use ImageIO because 1) it loads immediately (without need of MediaTracker), and 2) it returns BufferedImage

it would be simple to do:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
public BufferedImage getWebImage(String path) {
      try {
            return ImageIO.read(new URL(path).openStream());
      }
      catch (IOException e) {
            e.printStackTrace();
      }
      catch (MalformedURLException e) {
            e.printStackTrace();
      }
      return null;
}

then you can use:
1  
getWebImage(http://img78.exs.cx/img78/9144/sydney-character-season1.png");

to get your image.


I don't have to have an image, so a BufferedImage should be just fine.  I put in the code (quoted above), but I've got some "cannot resolve symbol" errors now.  I've tried adding different packages to the import list (java.lang.Exception.*; javax.imageio.*), but that doesn't make them go away.  Any ideas?

Thanks for your help and quick response!  You guys are awesome!

Nels
7  Game Development / Newbie & Debugging Questions / Really basic image loading question on: 2004-11-29 21:01:52
I must be braindead or something... I'm trying to get an image to load (in a JFrame, not an Applet) using Toolkit:

Code:
Image testCard;
testCard = Toolkit.getDefaultToolkit().getImage("http://img78.exs.cx/img78/9144/sydney-character-season1.png");

When I try to draw this image in my paint class it doesn't work.  I'll be adding a media tracker eventually, but I didn't think I should need it to just add this one test image...

Can anyone tell me why this might be screwed up?  Or recommend an different (and maybe easier) way to do it?

Thanks!
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (24 views)
2014-07-29 18:09:19

Riven (15 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (33 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (43 views)
2014-07-24 01:59:36

Riven (43 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!