Open console instead of window

Hello,

There is always javax.swing.JOptionPane for simple IO:

import javax.swing.JOptionPane;

int col;

void setup() {
  }

void draw() {
  background(col); 
  }

void keyPressed() {
  thread("MessageDialog_thread");
  } 

void MessageDialog_thread() {
  String strInp = JOptionPane.showInputDialog(null,"Enter a color 0 to 255:");
  col = int(strInp);
  JOptionPane.showMessageDialog(null, col, "Output", JOptionPane.PLAIN_MESSAGE);
  }

:)

2 Likes