Results 1 to 7 of 7
Thread: how to make grid number ?
- 05-26-2012, 06:06 PM #1
Member
- Join Date
- May 2012
- Posts
- 3
- Rep Power
- 0
- 05-26-2012, 08:12 PM #2
Re: how to make grid number ?
Moved from Java 2D
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 05-26-2012, 08:56 PM #3
Member
- Join Date
- Mar 2012
- Posts
- 26
- Rep Power
- 0
- 05-27-2012, 02:26 AM #4
Member
- Join Date
- May 2012
- Posts
- 3
- Rep Power
- 0
Re: how to make grid number ?
I have try using this code but it don't work in java 2d
for (int i=0; i <= 100; i++){
System.out.print(i+" ");
int mod = i % 10;
if (mod == 0)
System.out.print("\n");
}
or this
for (int i=1; i <= 100; i++){
int mod = i % 10;
if (mod == 0);
g2.drawString(i+"", x, y);
}
the problem is I don't know how to make it new line in java 2d
if it's in a normal java it has work alraedy.
- 05-27-2012, 03:55 AM #5
Re: how to make grid number ?
If you are using the drawString() method to write the String at one y location (on a row), you need to change the y value to draw the next String below the previous String. Change the x value to write in the next column on the same row beside the last String.how to make it new line in java 2dIf you don't understand my response, don't ignore it, ask a question.
- 05-27-2012, 05:30 AM #6
Re: how to make grid number ?
This has nothing to do with Java 2D (not java 2d) which is about drawing and manipulating geometrical figures and images.
Forum Rules
Guide For New Members
BB Code List - Java Programming Forum
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 05-28-2012, 05:02 PM #7
Member
- Join Date
- May 2012
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
Open Grid Scheduler/Grid Engine
By java software in forum Java SoftwareReplies: 0Last Post: 03-27-2012, 07:00 PM -
How do I make a grid of buttons work within a border layout??
By jazzgnat in forum New To JavaReplies: 3Last Post: 03-23-2012, 07:43 PM -
creating a make grid method
By Matt198525 in forum New To JavaReplies: 13Last Post: 10-29-2010, 02:47 AM -
how do i make a string return a number?
By pjr5043 in forum New To JavaReplies: 6Last Post: 09-15-2008, 04:56 AM -
Will make a pyramid of some kind out of a number
By romina in forum New To JavaReplies: 1Last Post: 08-07-2007, 05:20 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks