Find us on Google+ Kill the code: code killer
Showing posts with label code killer. Show all posts
Showing posts with label code killer. Show all posts

Sunday, 22 September 2013

Change background color of MDIParent Form in VB.Net

#Region "Change Background Color of MDIParent : bgcolor()"
    'to change the background color of mdiparent
    'for more : http://acomputerengineer.wordpress.com

    Private Sub bgColor()
    Dim child As Control
    For Each child In Me.Controls
        If TypeOf child Is MdiClient Then
            child.BackColor = Color.CadetBlue
        Exit For
        End If
    Next
    child = Nothing
    End Sub
#End Region

Sunday, 28 October 2012

Change Background Color using Jslider in Java

This program changes the background color using the three Jslider Red, Green and Blue. it also directly change to three basic color Red, Green, Blue using JpopupMenu using right click.

Here I attach one screenshot of it.




Thursday, 12 July 2012

Windmill effect in Java Applet




Code:


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication2;

import java.applet.Applet;
import java.awt.Dimension;
import java.awt.Graphics;
import java.lang.Math;

/**
 *
 * @author zero
 */
public class NewApplet extends Applet implements Runnable {
    Dimension d = getSize();
    int b = 200;
    int c = 200;
    int a = 0;
    int x = (int)(100 * Math.cos(Math.toRadians(a)));
    int y = (int)(100 * Math.cos(Math.toRadians(a)));
    int i = 1;
    public void run() {
        while(true) {
         
            for(i = 90; i >= 0; i--) {
                try {
                Thread.sleep(5);
                }
                catch(Exception e) {
                }
                a = i;
                x = (int)(100 * Math.cos(Math.toRadians(a)));
                y = (int)(100 * Math.sin(Math.toRadians(a)));
                //showStatus(x + "," + y);
                repaint();
            }
        }
    }

    /**
     * Initialization method that will be called after the applet is loaded into
     * the browser.
     */
    public void init()
        Thread t = new Thread(this);
        t.start();
    }
 
    public void paint(Graphics g) {
        g.drawLine(b, c, b, c + 200);
        g.drawLine(b, c, b + x, c + y);
        g.drawLine(b, c, b - x, c - y);
        g.drawLine(b, c, c + y, b - x);
        g.drawLine(b, c, c - y, b + x);
        //g.drawRect(0, 0, 550, 550);
    }
 
    // TODO overwrite start(), stop() and destroy() methods
}

Tare Zammen Par effect in Java Applet




Code :

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication2;

import java.applet.Applet;
import java.awt.Dimension;
import java.awt.Graphics;
import java.lang.Math;


/*<applet code=NewApplet1' width='500' height='500'></applet>*/
/**
 *
 * @author zero
 */
public class NewApplet1 extends Applet implements Runnable {
    int a, b;
    Dimension d = getSize();
    /**
     * Initialization method that will be called after the applet is loaded into
     * the browser.
     */
    public void init() {
        Thread t = new Thread(this);
        t.start();
    }
   
    public void run() {
        while(true) {
           
                d = getSize();
                try {
                Thread.sleep(1);
                }
                catch(Exception e) {
                }
           
                a = (int)(d.width * Math.random());
                b = (int)(d.height * Math.random());
                showStatus(d.width + "," + d.height);
                repaint();
           
        }
    }
   
    public void paint(Graphics g) {
        g.drawOval(a, b, 1, 1);
    }
   
    public void update(Graphics g) {
        paint(g);
    }
    // TODO overwrite start(), stop() and destroy() methods
}