Exporting Java application to a blank, gray screen.

edited April 2014 in Using Processing

Hi all,

Thanks to all the contributors on the these forums -- it's really a great resource and inspiration. I am trying to export a Java fullscreen application on Mac OS X running Processing 2.1.1. I'm running the latest Java JDK 8.

I've copied the text files to my application folder, but whenever the application is launched, I get a blank, gray screen. Any tips or ideas?

Code:

String[] captionList;
String[] textColors;
color[] colorColors;
int[] intColors;
int spectrum = 0;
int captionsize = 0;
int a = 0;
int b = 0;

void setup(){
  size(1024,768);
  background(255);
  frameRate(18);
  textSize(24);
  noStroke();

  captionList = loadStrings("bklyn_captions.txt");
  textColors = loadStrings("bklyn_colordata_hex.txt");
  intColors = new int[textColors.length];
  colorColors = new int[textColors.length];
  spectrum = textColors.length;
  captionsize = captionList.length;

  for( int i=0; i < textColors.length; i++){
    colorColors[i] = color( unhex( textColors[i].substring(0,2) ), unhex( textColors[i].substring(2,4) ), unhex( textColors[i].substring(4,6) ) );
    intColors[i] = color( colorColors[i] );
    //println( textColors[i] + " => (" + int(red(colorColors[i])) + ", " + int(green(colorColors[i])) + ", " + int(blue(colorColors[i])) + ") => " + intColors[i] );
  }



}

void draw() {
  fill(colorColors[int(random(0,spectrum))]);
  rect(int(random(width)), 0, 3, height);
  if (a >= 600){
    fill(255, 230);
    text(captionList[b], int(random(0,width-300)), int(random(10,height-20)));
    if ( b >= captionsize ){
      b = 0;
    }
    b++;
    a=0;
  }
  a++;
}

Thanks again!

Answers

Sign In or Register to comment.