Best Web Designs Of the World Forums  

Go Back   Best Web Designs Of the World Forums > PROGRAMMING FORUMS > GENERAL DEVELOPMENT ISSUES

Reply
 
LinkBack Thread Tools Display Modes
Old 06-11-2008, 08:23 AM   #1 (permalink)
Junior Member
 
Join Date: Jun 2008
Posts: 1
Default Java programming help needed, need help with graphic box and its movement?

g.setColor (Color.red);
g.drawRect (10, 20, 100, 15);
g.setColor (Color.pink);
g.fillRect (240, 160, 40, 110);

thats the rectangle made...in java

and i have a grid made with numbers from 1-50..
setLayout (new GridLayout (5, 5));
int m = 51;
for (int i = 0 ; i < 5 ; i++)
{
for (int j = 0 ; j < 10 ; j++)
{
m--;
add (new Label ("" + m));

and my problem is that i want to move the rectangle i made on the number...i can add and subtract myself...but the box just goes anywher, can anyone help me how to make array, with value of i and j...so it can be something like array [i][j] and then i can move the box with it...like box.position=array[i][j]...so i can add and subtract from array, and and move box on the number..
thanks a lot anyone who helps..
i need it badly
ImMoRtaL is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT. The time now is 09:57 AM.


Powered by vBulletin® Version 3.8.0 Beta 2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.