import java.applet.Applet; import java.awt.*; import java.awt.image.*; public class ColorPaint extends Applet { public void init() { ImagePalette ip = new ImagePalette(getCodeBase() + getParameter("red"), getCodeBase() + getParameter("orange"), getCodeBase() + getParameter("yellow"), getCodeBase() + getParameter("green"), getCodeBase() + getParameter("blue"), getCodeBase() + getParameter("violet")); DrawingArea canvas = new DrawingArea(ip); p("Running ColorPaint..."); setLayout(new GridLayout(1,1)); // GridBagLayout gb = new GridBagLayout(); //GridBagConstraints c = new GridBagConstraints(); // setLayout(gb); setBackground(Color.black); setForeground(Color.black); //c.gridwidth = GridBagConstraints.RELATIVE; //c.fill = GridBagConstraints.BOTH; //c.anchor = GridBagConstraints.NORTHWEST; //c.weightx = 1; //c.weighty = 1; // gb.setConstraints(ip, c); add(ip); // c.gridwidth = GridBagConstraints.REMAINDER; //c.fill = GridBagConstraints.BOTH; //c.weightx = 1; //c.weighty = 1; add(canvas); } private void p(String s) { System.out.println(s); } private void p(Exception e) { System.out.println(e); } }