Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Thursday, 3 January 2013

Zig Zag motion

On clicking the start button
Changed the ball's color to hgb

Using stop button






Using java swings ,I tried to make the zig zag motion  of a ball when it strikes the boundaries of the rectangle on clicking the "start" button It has a "stop" button and another button to change the ball's color to HGB.
The code is quite simple .First of all create a frame using JFrame as follow
JFrame a = new JFrame("Zig Zag");
After declaring its attributes ,create a class  say zigzag which inherits JPanel and another class say bounce which inherits JPanel and an interface ActionListener.Now declare an object of class bounce say bounce b;
After that declare the constructor zigzag() as follow
Before clicking the start button
b = new bounce();
JButton startButton = new JButton("Start");
JButton hgbButton = new JButton("Change color to HGB");
JButton stopButton = new JButton("Stop");
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
buttonPanel.add(startButton);
buttonPanel.add(hgbButton);
buttonPanel.add(stopButton);
 stopButton.setText("Stop now !");
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
this.add(buttonPanel);

this.add(b);
Now,for the start button set animation to true and for stop button set animation to false .To change the color to hgb use :
b.setBallColor(Color.getHSBColor(TOP_ALIGNMENT, TOP_ALIGNMENT, TOP_ALIGNMENT));
 Now,inside the class bounce define the radius,diameter ,velocity across Xaxis and Yaxis , paint()..

Monday, 10 December 2012

Simple ChatBot using C++

I tried to make a chat with a bot ..after being inspired by a samsung app -Palingo .
This is a C++ prohram which is  konsole based.
It takes an input from user and the response is random .It includes header files like iostream,cstdlib,string and ctime .
I made a string -response having the script .And an infinte while loop to proceed the script .
It is a simple c++ program ,more improved version will be provided soon ..........
Mail me to obtain its source code and if interested to make chatbot using swings .



Saturday, 9 June 2012

Kbuntu 12.04 and Windows -7

snapshot of my kde plasma desktop
Well,the development of linux is one of the most prominent example of free and open source software collaboration . Typically,linux is packaged in a format known as a linux diistribution for desktop and server use.Some popular mainstream Linux distribution includes Debian and its derivative such as Ubuntu,fedora,suse.It include the linux kernel,supporting utilities and libraries and usually a large amount of application software to fulfill the distribution's intended use.

A distribution oriented toward desktop and an accompanying desktop environment such as gnome or kde plasma. 


I recently installed Kbuntu 12.04 .And I like it though windows is also great .Actually both are great in their own way .I would say I would like to have both of them.Windows is highly user-friendly and kbuntu is highly systemic .



So,now I have both window-7 and Kbuntu 12.04 on my Acer AspiThe development of Linux is one of the most prominent examples of free and open source software collaboration: the underlying source code may be used, modified, and distributed—commercially or non-commercially—by anyone under licenses such as the GNU General Public License. Typically Linux is packaged in a format known as a Linux distribution for desktop and server use. Some popular mainstream Linux distributions include Debian (and its derivatives such as Ubuntu), Fedora and openSUSE. Linux distributions include the Linux kernel, supporting utilities and libraries and usually a large amount of application software to fulfill the distribution's intended use.




A distribution oriented toward desktop use will typically include the X Window System and an accompanying desktop environment such as GNOME or KDE Plasma. re 5750 laptop.


And I feel great about it!






Cheers!