Total members 11893 |It is currently Fri Nov 15, 2024 11:43 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





XOR of colors Mode in java
Code:
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(30209040);
    
g.setColor(Color.yellow);
    
g.fillOval(60309040);
    
g.setColor(Color.blue);
    
g.fillOval(140507040);
    
g.setXORMode(Color.yellow);
    
g.fillOval(100409040);
  }
  public static 
void main(String[] args) {
    
JFrame frame = new JFrame("Use XOR Mode");
    
frame.setSize(350200);
    
Container contentPane frame.getContentPane();
    
contentPane.add(new UseXORMode());
    
frame.show();
  }
  } 





Attachments:
File comment: the output
XORMode.gif
XORMode.gif [ 5.4 KiB | Viewed 8299 times ]

_________________
M. S. Rakha, Ph.D.
Queen's University
Canada
Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : XOR Mode in java
 Fill DataGrid In Connected Mode     -  
 2d game in java-Monster-Java 2D Game Graphics and Animation     -  
 What is Java API?!!!     -  
 java or .net     -  
 need help in java     -  
 Using FTP in java     -  
 what is java     -  
 Java course     -  
 Draw An Arc in java     -  
 java Expressions     -  



Topic Tags

Java Graphics






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
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