Add to Favorites    Make Home Page 35127 Online  
 Language Categories  
 Our Services  

Home » Java Home » Java Applets Home » Color Palatte In Java

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Color Palatte In Java
Author Sudha.P
Author Email sudha83_cse [at] yahoo.co.in
Description Color Palatte In Java.
Category Java » Java Applets
Hits 24109
Code Select and Copy the Code
import javax.swing.*; import java.awt.event.*; import java.awt.*; /*<applet code=colour.class height=200 width=200> </applet>*/ public class colour extends JApplet implements ActionListener { JPanel p,p1; JButton b,b1,b2,b3; Checkbox c,c1; TextArea area; Color d=new Color(255,0,0); Color d1=new Color(0,255,0); Color d2=new Color(0,0,255); Color d3=new Color(255,177,76); GridLayout g; public void init() { p=new JPanel(); p1=new JPanel(); g=new GridLayout(2,2); p1.setLayout(g); b=new JButton(); b1=new JButton(); b2=new JButton(); b3=new JButton(); b.setBackground(d); b1.setBackground(d1); b2.setBackground(d2); b3.setBackground(d3); area=new TextArea(" Welcome To Colour Palate ",25,25); CheckboxGroup cbg=new CheckboxGroup(); c=new Checkbox(" ForeGround ",cbg,true); c1=new Checkbox(" BackGround ",cbg,false); p.add(c); p.add(c1); p.add(area); p1.add(b); p1.add(b1); p1.add(b2); p1.add(b3); p.add(p1); getContentPane().add(p); b.addActionListener(this); b1.addActionListener(this); b2.addActionListener(this); b3.addActionListener(this); } public void actionPerformed(ActionEvent e) { Object obj=e.getSource(); if(obj==b) { if(c.getState()==true) area.setForeground(d); else area.setBackground(d); } if(obj==b1) { if(c.getState()==true) area.setForeground(d1); else area.setBackground(d1); } if(obj==b2) { if(c.getState()==true) area.setForeground(d2); else area.setBackground(d2); } if(obj==b3) { if(c.getState()==true) area.setForeground(d3); else area.setBackground(d3); } } }

Related Source Codes

Script Name Author
Sending mail Using JavaMail to Yahoo and Gmail accounts sai prasad
Simple Program in Java to Implement Multithreading Satish.K
Simple Calculator in Java Using Remote Method Invocation Satish.K
Guest Book Application Using Servlets Satish.K
String Manipulation Using Stringification Satish.K
String Manipulation Using Stringification Satish.K
Moving Ball Application Using Java Beans Satish.K
Rapid Roll game subrahmanyeswararao
student mgm arpan
Sourav Datta
Download Manager Sagar
Address Book in Java Rahul Chouhan
address book using java database connectivity(jdbc-msaccess) shekhar bansal
sun Steganography B.Rajavel
Connecting Java with MS-Access - Inserting data in Aseem

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions
Copyright ©2003-2017 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=811


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review