Tue Nov 11, 2008 6:09 pm
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class UseXORMode extends JPanel {
UseXORMode() {
setBackground(Color.black);
}
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.setColor(Color.red);
g.fillOval(30, 20, 90, 40);
g.setColor(Color.yellow);
g.fillOval(60, 30, 90, 40);
g.setColor(Color.blue);
g.fillOval(140, 50, 70, 40);
g.setXORMode(Color.yellow);
g.fillOval(100, 40, 90, 40);
}
public static void main(String[] args) {
JFrame frame = new JFrame("Use XOR Mode");
frame.setSize(350, 200);
Container contentPane = frame.getContentPane();
contentPane.add(new UseXORMode());
frame.show();
}
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.