Static methods in java can be called directly by classes not on instances.
Java Tips and Tricks
Monday, June 25, 2012
Java RGB colors
public RGBpanel()
{
setPreferredSize(new Dimension(300,300));
int red = Integer.parseInt(JOptionPane.showInputDialog("Ente r red value"));
int green = Integer.parseInt(JOptionPane.showInputDialog("Ente r green value"));
int blue = Integer.parseInt(JOptionPane.showInputDialog("Ente r blue value"));
Color colr = new Color(red,green,blue);
setBackground(colr);
}
{
setPreferredSize(new Dimension(300,300));
int red = Integer.parseInt(JOptionPane.showInputDialog("Ente r red value"));
int green = Integer.parseInt(JOptionPane.showInputDialog("Ente r green value"));
int blue = Integer.parseInt(JOptionPane.showInputDialog("Ente r blue value"));
Color colr = new Color(red,green,blue);
setBackground(colr);
}
Subscribe to:
Posts (Atom)