how to read colors or shapes on monitor java code example
Example 1: Write a simple java swing application that will display rectangle graphics as shown in the picture below:
import javax.swing.JApplet;
public class RandomStringsApplet extends JApplet {
public void init() {
String message = getParameter("message");
RandomStringsPanel content = new RandomStringsPanel(message);
setContentPane(content);
}
}
Example 2: Write a simple java swing application that will display rectangle graphics as shown in the picture below:
Color myColor = new Color(r,g,b);