• Log in or sign up for an account here: https://www.sythe.org/login

New Programmer, Little help?

Ruski76

Newcomer
Joined
Jan 1, 2009
Sythe Gold
0
Messages
4
Im new to java programming. I've established this from a tutorial now how do i actually put this somewhere? Like on a client or console or some kind of window?>_<

Code:
 import java.applet.*;
 import java.awt.*;

 public class risingsun extends Applet {

 public void paint(Graphics g)
 {
     g.setColor(Color.blue);
     g.fillRect( 0, 0, 200, 100);
     g.setColor(Color.yellow);
     g.fillOval(25,25,50,50);
     g.fillArc(0,0,100,100,180,10);
     g.fillArc(0,0,100,100,160,10);
     g.fillArc(0,0,100,100,140,10);
     g.fillArc(0,0,100,100,120,10);
     g.fillArc(0,0,100,100,100,10);
     g.fillArc(0,0,100,100,800,10);
     g.fillArc(0,0,100,100,60,10);
     g.fillArc(0,0,100,100,40,10);
     g.fillArc(0,0,100,100,20,10);
     g.fillArc(0,0,100,100,0,10);
     Color ground = new Color(128,64,0);
     g.setColor(ground);
     g.fillRect( 0, 50, 200, 50);
     g.setColor(Color.black);
     g.drawString("Hello Sweden!",70,50);
 }

 }
 
Well from this you would need to make this into either a .java or a .class then use a program to make the .class file into a .Jar (java executable)

if you need help you can add my msn ([email protected])
 
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
You need the java jdk. Then you need to save it as a .java file and compile it, and then run it using command prompt. You may want to search google for a tut on how to compile and run a java program.
 
Well from this you would need to make this into either a .java or a .class then use a program to make the .class file into a .Jar (java executable)

if you need help you can add my msn ([email protected])

I added you through my yim please accept. Add my Yahoo instant messenger its [email protected]. I have to go but ill be back on tommorow. Also if anybody else could help me please add either my yim or my aim which is -mmysql.
 
Guys, this is an applet so he would need to first embed inside a HTML file and then view in the browser or with appletviewer.
 
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
Guys, this is an applet so he would need to first embed inside a HTML file and then view in the browser or with appletviewer.

Did not even notice... Well he still needs to compile it. :/
 
Could somebody make me a compiler that would convert it into a .class then which i could use to put in an html file?

nvm i got it.
 
you dont need to embed this into html...
you can create a jframe and a jpanel.
 
Member of the Month Winner
Sythe's 10th Anniversary
I suggest you fix your naming conventions as well.

Class names are always capitalized.
They don't have to be, but it is the commonly accepted standard that they are.

Personally, when writing my classes I will name them depending on how many different words I have to string together (depending on the language), for example:

class myClass

Just some habit I started for myself.
 
They don't have to be, but it is the commonly accepted standard that they are.

Personally, when writing my classes I will name them depending on how many different words I have to string together (depending on the language), for example:

class myClass

Just some habit I started for myself.

Yeah I know they didn't have to be, though it's always nice to encourage a habit of good conventions.
 
Runescape Gamblingrunescape gambling
Back
Top