New Programmer, Little help?

Discussion in 'Programming General' started by Ruski76, Jan 1, 2009.

New Programmer, Little help?
  1. Unread #1 - Jan 1, 2009 at 7:56 PM
  2. Ruski76
    Joined:
    Jan 1, 2009
    Posts:
    4
    Referrals:
    0
    Sythe Gold:
    0

    Ruski76 Newcomer

    New Programmer, Little help?

    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);
     }
    
     }
    
     
  3. Unread #2 - Jan 1, 2009 at 9:58 PM
  4. skyline0114
    Joined:
    Jul 31, 2008
    Posts:
    60
    Referrals:
    0
    Sythe Gold:
    0

    skyline0114 Member
    Banned

    New Programmer, Little help?

    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])
     
  5. Unread #3 - Jan 1, 2009 at 10:24 PM
  6. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    New Programmer, Little help?

    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.
     
  7. Unread #4 - Jan 1, 2009 at 11:57 PM
  8. Ruski76
    Joined:
    Jan 1, 2009
    Posts:
    4
    Referrals:
    0
    Sythe Gold:
    0

    Ruski76 Newcomer

    New Programmer, Little help?

    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.
     
  9. Unread #5 - Jan 2, 2009 at 12:49 AM
  10. Zyloch
    Joined:
    Apr 21, 2005
    Posts:
    63
    Referrals:
    0
    Sythe Gold:
    0

    Zyloch Member

    New Programmer, Little help?

    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.
     
  11. Unread #6 - Jan 2, 2009 at 1:01 AM
  12. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    New Programmer, Little help?

    Did not even notice... Well he still needs to compile it. :/
     
  13. Unread #7 - Jan 2, 2009 at 11:18 AM
  14. Ruski76
    Joined:
    Jan 1, 2009
    Posts:
    4
    Referrals:
    0
    Sythe Gold:
    0

    Ruski76 Newcomer

    New Programmer, Little help?

    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.
     
  15. Unread #8 - Jan 14, 2009 at 12:27 AM
  16. Wehrmacht
    Joined:
    Jan 14, 2009
    Posts:
    24
    Referrals:
    0
    Sythe Gold:
    0

    Wehrmacht Newcomer

    New Programmer, Little help?

  17. Unread #9 - Feb 2, 2009 at 9:44 PM
  18. xxelitexx
    Joined:
    Feb 2, 2009
    Posts:
    21
    Referrals:
    0
    Sythe Gold:
    0

    xxelitexx Newcomer

    New Programmer, Little help?

    you dont need to embed this into html...
    you can create a jframe and a jpanel.
     
  19. Unread #10 - Feb 3, 2009 at 5:22 PM
  20. Benz
    Joined:
    Apr 30, 2007
    Posts:
    255
    Referrals:
    0
    Sythe Gold:
    0

    Benz Forum Addict

    New Programmer, Little help?

    I suggest you fix your naming conventions as well.

    Class names are always capitalized.
     
  21. Unread #11 - Feb 5, 2009 at 4:03 AM
  22. Swan
    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner

    Swan When They Cry...
    Retired Global Moderator

    New Programmer, Little help?

    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.
     
  23. Unread #12 - Feb 5, 2009 at 8:25 PM
  24. Benz
    Joined:
    Apr 30, 2007
    Posts:
    255
    Referrals:
    0
    Sythe Gold:
    0

    Benz Forum Addict

    New Programmer, Little help?

    Yeah I know they didn't have to be, though it's always nice to encourage a habit of good conventions.
     
< JavaScript is NOT only a web programming language! | Usfull Tutorial Site >

Users viewing this thread
1 guest


 
 
Adblock breaks this site