Hello,

My teacher asked us to write a little O.S simulator, my group has to write the file system module. We are using contiguous block alocation for the files, we would like to represent the utilization of the blocks using a colored matrix, where the used blocks would be red and the free blocks would be green, and there would be the block number inside the square. I tried to use JTable but it seems to not be the perfect component to do this. Any Suggestions?

You could simply have a load of JLabels in a GridLayout and set their text and background colours as required. You could use an array of the JLabels to keep track of them and access individual ones.

Interesting, I'll try that. Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.