New Posts  All Forums:Forum Nav:

applets

post #1 of 2
Thread Starter 
i have a program written which i shal provide the code which generates random numbers in an array. they r then sorted and i have it run in an applet. now what i need to do lets say one of the random numbers is 2 it generates a box 2 high. how do i do that
Prebuilt rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
core 2 quad q9550 asus p5n-d  GTX 550 TI 8gb corsair xms2 2x4gb pairs 
Hard DriveOptical DriveOSMonitor
500gb sata drive & 2tb sata2 drive cd/dvd + cd/dvd burner windows vista ultimate 64bit aces x193w 
KeyboardPowerCaseMouse
microsoft keyboard 850 watts xigmatex modular psu cool master logitech optical 
  hide details  
Reply
Prebuilt rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
core 2 quad q9550 asus p5n-d  GTX 550 TI 8gb corsair xms2 2x4gb pairs 
Hard DriveOptical DriveOSMonitor
500gb sata drive & 2tb sata2 drive cd/dvd + cd/dvd burner windows vista ultimate 64bit aces x193w 
KeyboardPowerCaseMouse
microsoft keyboard 850 watts xigmatex modular psu cool master logitech optical 
  hide details  
Reply
post #2 of 2
First off, if you are using an Applet, use JApplet instead.

In your paint method, you will have a java.awt.Graphics object passed in as a parameter.

Look at the javadoc for java.awt.Graphics. Particularly the drawRect method.

iterate through the collection of numbers that you have generated and paint them. Make sure you force an update to actually render to the screen.
Serene Power
(13 items)
 
  
CPUMotherboardGraphicsRAM
Dual Xeon E5620 Supermicro X8DAL-i EVGA 570HD SC 8GiB Corsair DDR3 1333 ECC-R 
Hard DriveOptical DriveOSMonitor
OCZ Agility 3 120GB SSD (+16TB NAS) LG 10x Blu-Ray Windows 7 x64 / Debian x64 Dell 2408WFP, P2411H 
PowerCase
850W CoolerMaster SilentPro M CoolerMaster Cosmos Pure 
  hide details  
Reply
Serene Power
(13 items)
 
  
CPUMotherboardGraphicsRAM
Dual Xeon E5620 Supermicro X8DAL-i EVGA 570HD SC 8GiB Corsair DDR3 1333 ECC-R 
Hard DriveOptical DriveOSMonitor
OCZ Agility 3 120GB SSD (+16TB NAS) LG 10x Blu-Ray Windows 7 x64 / Debian x64 Dell 2408WFP, P2411H 
PowerCase
850W CoolerMaster SilentPro M CoolerMaster Cosmos Pure 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming