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 1 of 1

Thread: Drawing

  1. #1
    Junior Member
    Join Date
    Apr 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Drawing

    I need to draw eight dots under each other as such:
    O O
    O O
    O O
    O O
    but i hve code in place that'll only colour the ones i have... any sugeestions??

    StdDraw.setCanvasSize(1000,400);
    		StdDraw.setXscale(0,1000);
    		StdDraw.setYscale(1,maxY);
     
    		int Xoffset =0;
    		int Yoffset = 0;
    		char[][] bin = new char [4][2];
    		bin[0][0] = binStr.charAt(7);
    		bin[0][1] = binStr.charAt(4);	
    		bin[1][0] = binStr.charAt(6);
    		bin[1][1] = binStr.charAt(3);
    		bin[2][0] = binStr.charAt(5);
    		bin[2][1] = binStr.charAt(2);
    		bin[3][0] = binStr.charAt(1);
    		bin[3][1] = binStr.charAt(0);
     
    		for (int dotx =0 ;dotx<4; dotx++){
    			for (int doty = 0; doty<2; doty++){
    				if (bin[dotx][doty] == '1')
    				{
    					StdDraw.filledCircle(???????,?????,????? );
     
    				}


    HELLLLLPPPP!!!!
    Last edited by toxikbuni; April 20th, 2010 at 02:54 PM.


Similar Threads

  1. Replies: 4
    Last Post: July 20th, 2010, 07:15 AM
  2. Drawing circles with smoother lines?
    By tabutcher in forum Java Theory & Questions
    Replies: 4
    Last Post: April 18th, 2010, 10:12 AM
  3. keeping an drawing centered in Graphics
    By dvsumosize in forum What's Wrong With My Code?
    Replies: 0
    Last Post: February 27th, 2010, 11:26 PM
  4. Drawing image on JPanel from another frame
    By jeryslo in forum AWT / Java Swing
    Replies: 3
    Last Post: December 8th, 2009, 04:01 PM
  5. Drawing "Hello world" on screen
    By shikh_albelad in forum Java SE APIs
    Replies: 4
    Last Post: June 11th, 2009, 03:21 AM