Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

RGB Color...

807607Oct 20 2006 — edited Oct 20 2006
// I wanted to make a RGB Color and put it in a JFrame
// But I can't...

// The Code:

import java.awt.Color;
import javax.swing.JFrame;

public class ColorMaker {

public static void main(String args[]) {

Color [][][] RGBColors = new Color [256][256][256];

Color other = null;
RGBColors [40][40][40] = other;


JFrame f = new JFrame("A Box");
f.setVisible(true);
f.setSize(300, 300);
f.setBackground(other);
}
}

// But when I compile the code I get...
// Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
// Help Please...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 17 2006
Added on Oct 20 2006
33 comments
226 views