Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: ColorBox or song box to put on

  1. #1
    Member
    Join Date
    Dec 2013
    Location
    Honolulu
    Posts
    83
    Thanks
    1
    Thanked 4 Times in 2 Posts

    Default ColorBox or song box to put on

    see if this juke box works on canvas on your friend's PC. Sheryl Crow, soak up the sun
    [QUOTE]
    package helloworld;
    import java.lang.*;
    import java.awt.*;
    import java.awt.Canvas;
    import java.awt.Graphics;

    /**
    *
    * @author Tiki808(me on the garden island forum)
    */
    public class ColorBox extends Canvas { //start of the class
    //Sheryl Crow, soak up the sun video

    public ColorBox() //calling this class accesses the Static variables
    { //in the main method
    setSize(800,600);
    setBackground(gray);
    drawRect(100, 100, 800, 600);
    fillRect(gray);
    drawRect(120, 120, 600, 400);
    fillRect(aqua);
    drawRect(140, 140, 400, 400);
    fillRect(white);
    ImageIcon pic = new ImageIcon("<iframe width=\"640\" height=\"360\" src=\"//www.youtube.com/embed/KIYiGA_rIls?feature=player_embedded\" frameborder=\"0\" allowfullscreen></iframe>");
    } //end constructor

    public static void main(String[] args) { //main method or known as static variables
    try {
    system.out.println("error message!");
    } catch(java.lang.RuntimeException); {


    }

    }

    /* Create and display the form */
    new Runnable() {
    public void run() {
    new ColorBox().setVisible(true);
    }
    });
    } //end class
    /QUOTE]


  2. #2
    Member Abhilash's Avatar
    Join Date
    Jun 2014
    Location
    Kolkata, West Bengal, INDIA
    Posts
    108
    My Mood
    Busy
    Thanks
    5
    Thanked 10 Times in 10 Posts

    Lightbulb Re: ColorBox or song box to put on

    You can format your Java Code this way so that it looks like........ well.... um... you'll know.

Similar Threads

  1. Can't find the out put
    By javab4 in forum Loops & Control Statements
    Replies: 1
    Last Post: November 4th, 2013, 05:07 PM
  2. 4 Pics 1 Song.
    By jaydac12 in forum Android Development
    Replies: 0
    Last Post: September 20th, 2013, 11:52 PM
  3. Java Song class
    By brandalicious78 in forum What's Wrong With My Code?
    Replies: 11
    Last Post: April 23rd, 2013, 09:41 AM
  4. Making an input dialog box appear after closing a combo box
    By Shenaniganizer in forum What's Wrong With My Code?
    Replies: 14
    Last Post: November 11th, 2012, 06:22 PM
  5. How to take input dynamically and display?
    By abielm_007 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 29th, 2009, 05:51 PM