Page 1030 of 1703

Posted: Sat May 06, 2006 4:59 am
by dj_venom
A new file that uses which code? Your HTML one or the pdf one? And new file as in what type of file?

Sorry if I'm asking heaps of questions, but this is flying over my head.

Posted: Sat May 06, 2006 4:59 am
by Greg.
I'm probably going to change my name at some point... And maybe get an avatar... Not sure though...

Posted: Sat May 06, 2006 5:05 am
by Ravager
You can't change your name...well, not unless you ask Buck, so it's not too easy. An avatar is a good idea though. :)
[QUOTE=dj_venom]A new file that uses which code? Your HTML one or the pdf one? And new file as in what type of file?

Sorry if I'm asking heaps of questions, but this is flying over my head.[/QUOTE]
No, it's fine...just make a completely new, separate file in Notepad, copy in the html stuff...
<HTML>
<APPLET code="NewApplet.class" WIDTH = 300 HEIGHT = 200 ></APPLET>
</HTML>
Then save the file with the .html extension, save it in the same folder as the java files and open it.

Posted: Sat May 06, 2006 5:08 am
by dj_venom
Okay, got that. But where do I put all that applet code?

In which bracket does it fit into?

Posted: Sat May 06, 2006 5:17 am
by Ravager
Well, just save that stuff as an ordinary java file.

Getting the applet java file and the other java file you have working together may be a little trickier but focus on getting the applet to work first.

Posted: Sat May 06, 2006 5:20 am
by Greg.
[QUOTE=Ravager]You can't change your name...well, not unless you ask Buck, so it's not too easy. An avatar is a good idea though. :)
[/QUOTE]

Juni changed hers...

I have no I dea about avatars/signatures... :mad:

Posted: Sat May 06, 2006 5:22 am
by dj_venom
Hey Greg, sorry to have been ignoring, but busy here.

Yeah, people have changed (Fas to CM; Hill1 to Hill-Shatar etc.), but it's just a bit of work for Buck. You can always ask though, but he may not always grant it, and grant it immediately.

Rav, alright, I'll give it a try and see what I can do.

Posted: Sat May 06, 2006 5:23 am
by Ravager
[QUOTE=GregtheSleeper]Juni changed hers...[/QUOTE]
Yeah, she had to PM Buck too...just like Hill did back when he was hill1. Still, it's not that common for people to change their names here.
Just like DJV beat me to saying. :p

[QUOTE=GregtheSleeper]I have no I dea about avatars/signatures... :mad: [/QUOTE]
Oh, you'll find something, it's not like it has to be incredibly significant or anything, just a picture you like for the avtar (and fits with the rules obviously).

Posted: Sat May 06, 2006 5:24 am
by dj_venom
And if you're good with animation, you can make your own avatars, like I make mine :) .

So Rav, I'll put it in a new java file, but where in it, as in, between which brackets?

Code: Select all

/*
 * Camelapplet.java
 *
 * Created on 6 May 2006, 21:22
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package camelgame;

/**
 *
 * @author Daniel
 */
public class Camelapplet {
    
    /** Creates a new instance of Camelapplet */
    public Camelapplet() {
    }
}

Posted: Sat May 06, 2006 5:28 am
by Ravager
[QUOTE=dj_venom]And if you're good with animation, you can make your own avatars, like I make mine :) .[/QUOTE]

And like I made mine! :D

Code: Select all

/*
 * Camelapplet.java
 *
 * Created on 6 May 2006, 21:22
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package camelgame;

/**
 *
 * @author Daniel
 */
public class Camelapplet [b]extends Applet implements ActionListener[/b]{

}
Below the bold part, I think...I'm more used to writing the code myself than using NetBeans, it just mixes up the code. :o

Posted: Sat May 06, 2006 5:30 am
by Greg.
Right...

I'm off...

See you later guys...

Thanks for the help

Posted: Sat May 06, 2006 5:32 am
by Ravager
Sure, talk to you later Greg. :)

Posted: Sat May 06, 2006 5:33 am
by dj_venom
Seeya later Greg, look forward to your avatar :) .

Okay Rav, I did that, and I ended up with two errors:

Code: Select all

D:\Camelgame\src\camelgame\Camelapplet.java:17: illegal start of type
import java.applet.*
D:\Camelgame\src\camelgame\Camelapplet.java:21: <identifier> expected
public class CamelApplet extends Applet implements ActionListener
2 errors
BUILD FAILED (total time: 0 seconds)

Posted: Sat May 06, 2006 5:39 am
by Ravager
Well, you need a semi-colon after the first one.

Not sure about the other one.
Did you copy all the code fom the sample to underneath that line?

Posted: Sat May 06, 2006 5:42 am
by dj_venom
Yeah, I had copied exactly. Then I found that by deleting the semi-colon it removed heaps of problems. Here is it exactly:

Code: Select all

init:
deps-jar:
Compiling 1 source file to D:\Camelgame\build\classes
D:\Camelgame\src\camelgame\Camelapplet.java:17: illegal start of type
import java.applet.*;
D:\Camelgame\src\camelgame\Camelapplet.java:17: <identifier> expected
import java.applet.*;
D:\Camelgame\src\camelgame\Camelapplet.java:18: illegal start of type
import java.awt.*;
D:\Camelgame\src\camelgame\Camelapplet.java:18: <identifier> expected
import java.awt.*;
D:\Camelgame\src\camelgame\Camelapplet.java:19: illegal start of type
import java.awt.event.*;
D:\Camelgame\src\camelgame\Camelapplet.java:19: <identifier> expected
import java.awt.event.*;
D:\Camelgame\src\camelgame\Camelapplet.java:20: illegal start of type
import javax.swing.*;
D:\Camelgame\src\camelgame\Camelapplet.java:20: <identifier> expected
import javax.swing.*;
8 errors
BUILD FAILED (total time: 0 seconds)

Posted: Sat May 06, 2006 5:45 am
by Ravager
Well, you can't go for the least errors, you know...you have to battle away at it, even if it goes from 1 to 20 errors after you fix one...

Where exactly did you put the import statements in the program? Above the public class line?

Posted: Sat May 06, 2006 5:52 am
by dj_venom
Lol, I know. :rolleyes:

I went throught the main thing properly, and decoded all of it. But our teacher didn't teach us applets, so I have no idea what to do.

Anyway, here is the code:

Code: Select all

package camelgame;

/**
 *
 * @author Daniel
 */
public class Camelapplet extends Applet implements ActionListener{
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class CamelApplet extends Applet implements ActionListener
{
private TextArea resultArea;
<etc. continues on from pdf>

Posted: Sat May 06, 2006 5:54 am
by Ravager
Ahh, I see the problem. Take out the bold line.

Code: Select all

package camelgame;

/**
 *
 * @author Daniel
 */
[b]public class Camelapplet extends Applet implements ActionListener{[/b]
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class CamelApplet extends Applet implements ActionListener
{
private TextArea resultArea;
<etc. continues on from pdf>

Posted: Sat May 06, 2006 6:02 am
by dj_venom
Well that removed those errors, but it left us with two...

Code: Select all

init:
deps-jar:
Compiling 1 source file to D:\Camelgame\build\classes
D:\Camelgame\src\camelgame\Applet.java:20: class CamelApplet is public, should be declared in a file named CamelApplet.java
public class CamelApplet extends Applet implements ActionListener
D:\Camelgame\src\camelgame\Applet.java:20: cannot access camelgame.Applet
bad class file: D:\Camelgame\src\camelgame\Applet.java
file does not contain class camelgame.Applet
Please remove or make sure it appears in the correct subdirectory of the classpath.
public class CamelApplet extends Applet implements ActionListener
2 errors
The problem line being

Code: Select all

public class CamelApplet extends Applet implements ActionListener

Posted: Sat May 06, 2006 6:07 am
by Ravager
Okay, make sure the java file is saved as CamelApplet and not something like NewApplet.
Use Save As, or whatever the NetBeans equivalent is.
That might fix both errors.