Skip to main content

Posts

Showing posts from February 14, 2012

Java Programming E-books

Cracking the Coding Interview: 150 Programming Questions and Solutions Head First Java, 2nd Edition What's New in Java 7? Effective Java (2nd Edition) BuzzNet Tags: Head First Java , New in Java 7 , Java

Java GUI Tutorial – Part 2

Introduction This tutorial will teach you about Graphical User Interfaces, or GUI’s. GUI’s are important because it’s an effective way for the user to interact with the program. The way Java allows you to create GUI’s is the Abstract Windowing Toolkit, or AWT. Up until now you’ve only learned how to make a nice looking GUI, what you’ll learn now will teach you how to make them actually *DO* stuff! You do this using the java.awt.event.* package. Well, time to start learning events! Setting Up Your Program To receive events, first you have to include some packages and an interface or two. An interface is something which adds to your programs functionality. First, you must import the java.awt.event.* package: import java.awt.event.*; Next, you need to include one of the EventListener interfaces. This applet includes the ActionListener interface: public class MyApplet extends java.applet.Applet implements ActionListener { The EventListener interfaces enable a component of a graphi

Java GUI Tutorial – Part 1

Introduction This tutorial will teach you about Graphical User Interfaces, or GUI’s. GUI’s are important because it’s an effective way for the user to interact with the program. The way Java allows you to create GUI’s is the Abstract Windowing Toolkit, or AWT. The java.awt package includes: Ø Buttons, checkboxes, labels, other basic components Ø Text fields, text areas, and other more complex components Ø Dialog boxes and other windows Ø Drop down boxes and other menus This tutorial is divided into two parts – The first one (which you’re reading right now) will teach you about the different AWT components. It will teach you what they are, how to use them, give a complete working example of it (located in the Part 1 folder in the Code directory), and give a screenshot of what it looks like. The second one will teach you about all the events that these different objects have. You’ll learn how to set up event handling, how to detect which object the event belongs to, and more. Wel

C Language Programs for beginners-1

Control Statements programs: 1 Program to Find Largest of Three Numbers #include <stdio.h> #include<conio.h> void main() { int a, b, c; clrscr(); printf("\nEnter three numbers: "); scanf("%d %d %d", &a, &b, &c); if (a>b && a>c) printf("\n\n%d is greater", a); else if (b>a && b>c) printf("\n\n%d is greater", b); else printf("\n\n%d is greater", c); getch(); } 2 Program to Check Whether a Character is Vowel or not by using switch Statement #include<conio.h> #include<stdio.h> void main() { char ch; clrscr(); printf("\nEnter any character: "); scanf("%c", &ch); switch (ch) { case 'a': case 'A': printf("\n\n%c is a vowel", ch); break; case 'e': case 'E': printf("\n\n%c is a vowel", ch); break; case 'i': case 'I': printf("\n\n%c is a vowel", ch); break; case 'o