Sunday, March 20, 2011


The Passage by Justin Cronin The Irresistible Henry House by Lisa Grunwald
Justin Cronin's gorgeous writing brings depth and vitality to this ambitious, terrifying epic about a virus that nearly destroys the world. The Passage takes readers on a journey from the early days of the virus to the aftermath of the destruction, where packs of hungry infected scour the razed, charred cities looking for food, and the survivors eke out a bleak, brutal existence. Cronin doesn't shy away from identifying his "virals" as vampires, but they're a far cry from the angsty, romantic types you might expect, and they're inextricably linked to the one girl who could destroy them all. The Passage is a grand mashup of literary and supernatural, a stunning beginning to a trilogy that is sure to dazzle readers of both genres.

Click Here to see & but all the best book of 2010

Monday, September 21, 2009

EJB E-book

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform, Enterprise Edition (Java EE). EJB technology enables rapid and simplified development of distributed, transactional, secure and portable applications based on Java technology.

Download free e-book

EJB
EJB
EJB
CMP Bean in NetBeans 5.5.1 using MS SQL Server 2005
CMP Bean using Derby Database
EJB [BMP].
EJB [Configure a DataSource]
EJB [Stateful SessionBean]
EJB [Stateless SessionBean] Steps
EJB [Stateless SessionBean]
Enhancements in Java 6
HeadFirst-EJB
Internationalization in Java
Java Beans
ava Mail using Swing
MDB using SJS App Server 8.2 in NetBeans 5.0
Manning.EJB.3.in.Action.Apr.2007
Mastering Enterprise Java Beans
MasteringEJB3rdEd
O'Reilly - Enterprise Java Beans
Wiley-EJB.and.JSP.Java.on.the.Edge
Enterprise JavaBeans, 3rd Edition
bitterEJB
java extreme programming cookbook
proEJB3-javaPersistenceAPI

Java E-book

A high-level programming language developed by Sun Microsystems. Java was originally called OAK, and was designed for handheld devices and set-top boxes. Oak was unsuccessful so in 1995 Sun changed the name to Java and modified the language to take advantage of the burgeoning World Wide Web.

Java is an object-oriented language similar to C++, but simplified to eliminate language features that cause common programming errors. Java source code files (files with a .java extension) are compiled into a format called bytecode (files with a .class extension), which can then be executed by a Java interpreter. Compiled Java code can run on most computers because Java interpreters and runtime environments, known as Java Virtual Machines (VMs), exist for most operating systems, including UNIX, the Macintosh OS, and Windows. Bytecode can also be converted directly into machine language instructions by a just-in-time compiler (JIT).

Java is a general purpose programming language with a number of features that make the language well suited for use on the World Wide Web. Small Java applications are called Java applets and can be downloaded from a Web server and run on your computer by a Java-compatible Web browser, such as Netscape Navigator or Microsoft Internet Explorer.

Download Free E-book

O'Reilly - Java IO
1000_Java_Tips_low
Advanced Java 2 Platform How to Program (JDK 1.3, J2EE 1.2) 2001
HeadFirst JAVA
Interactive programming in java
J2EETutorial
J2ME_Game_Development_with_MIDP2
Java - J2ME in a Nutshell __found_@_[redsamara.com]
Java 2 Bible Enterprise Edition
Java 2 Network Security
Java 2--Complete Reference2
Java 330_tips
Java Bible Database Programming
Java Programming with Oracle JDBC (2002)
Java
Java_Design_Objects__UML__and_Process
Modeling the J2EE in UML and Rational Rose
O'Reilly - Developing Java Beans-1
O'Reilly - Java 2d graphics
O'Reilly - Java Cryptography
O'Reilly - Java Distributed Computing
O'Reilly - Java Message Service
O'Reilly - Java RMI
O'Reilly - Java Threads 2nd
O'Reilly - Java and XML
O'Reilly - JavaServer Faces
O'Reilly Java Servlet Programming
Teach_Yourself_Java
The Java Language Specification 3rd Ed
Think IN java
Wrox - Beginning Java 2 JDK 5 Edition - 2005
Wrox - Beginning Java 2 JDK 5 Edition - 2005
apress_-_bluetooth_for_java__2003
core java 2, volume i fundamentals 5th
core java 2, volume ii advanced features
O'Reilly - Learning Java
goodbook
j2MEstepbystep
javacryptographyreilly
sybex-javafoundations

Saturday, September 12, 2009

Easy way to study Java :: JInternalFrame

Java Swing Tutorial Explaining the JInternalFrame class. A JInternalFrame is confined to a visible area of a container it is placed in. JInternalFrame a top level swing component that has a contentpane.

  • It can be iconified — in this case the icon remains in the main application container.
  • It can be maximized — Frame consumes the main application
  • It can be closed using standard popup window controls
  • It can be layered

JInternalFrame Source Code

import javax.swing.JInternalFrame;
import javax.swing.JDesktopPane;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JMenuBar;
import javax.swing.JFrame;
import java.awt.event.*;
import java.awt.*;

public class JInternalFrameDemo extends JFrame {

JDesktopPane jdpDesktop;
static int openFrameCount = 0;
public JInternalFrameDemo() {
super("JInternalFrame Usage Demo");
// Make the main window positioned as 50 pixels from each edge of the
// screen.
int inset = 50;
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds(inset, inset, screenSize.width - inset * 2,
screenSize.height - inset * 2);
// Add a Window Exit Listener
addWindowListener(new WindowAdapter() {


public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
// Create and Set up the GUI.
jdpDesktop = new JDesktopPane();
// A specialized layered pane to be used with JInternalFrames
createFrame(); // Create first window
setContentPane(jdpDesktop);
setJMenuBar(createMenuBar());
// Make dragging faster by setting drag mode to Outline
jdpDesktop.putClientProperty("JDesktopPane.dragMode", "outline");
}
protected JMenuBar createMenuBar() {
JMenuBar menuBar = new JMenuBar();
JMenu menu = new JMenu("Frame");
menu.setMnemonic(KeyEvent.VK_N);
JMenuItem menuItem = new JMenuItem("New IFrame");
menuItem.setMnemonic(KeyEvent.VK_N);
menuItem.addActionListener(new ActionListener() {

public void actionPerformed(ActionEvent e) {
createFrame();
}
});
menu.add(menuItem);
menuBar.add(menu);
return menuBar;
}
protected void createFrame() {
MyInternalFrame frame = new MyInternalFrame();
frame.setVisible(true);
// Every JInternalFrame must be added to content pane using JDesktopPane
jdpDesktop.add(frame);
try {
frame.setSelected(true);
} catch (java.beans.PropertyVetoException e) {
}
}
public static void main(String[] args) {
JInternalFrameDemo frame = new JInternalFrameDemo();
frame.setVisible(true);
}
class MyInternalFrame extends JInternalFrame {

static final int xPosition = 30, yPosition = 30;
public MyInternalFrame() {
super("IFrame #" + (++openFrameCount), true, // resizable
true, // closable
true, // maximizable
true);// iconifiable
setSize(300, 300);
// Set the window's location.
setLocation(xPosition * openFrameCount, yPosition
* openFrameCount);
}
}
}

Output


Java JInternalFrame Hierarchy

javax.swing
Class JInternalFrame
java.lang.Object
|
+–java.awt.Component
|
+–java.awt.Container
|
+–javax.swing.JComponent
|
+–javax.swing.JInternalFrame
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, RootPaneContainer, Serializable, WindowConstants

JInternalFrame Constructor

JInternalFrame()
Creates a non-resizable, non-closable, non-maximizable, non-iconifiable JInternalFrame with no title.
JInternalFrame(String title)
Creates a non-resizable, non-closable, non-maximizable, non-iconifiable JInternalFrame with the specified title.

JInternalFrame(String title, boolean resizable)
Creates a non-closable, non-maximizable, non-iconifiable JInternalFrame with the specified title and resizability.

JInternalFrame(String title, boolean resizable, boolean closable)
Creates a non-maximizable, non-iconifiable JInternalFrame with the specified title, resizability, and closability.

JInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable)
Creates a non-iconifiable JInternalFrame with the specified title, resizability, closability, and maximizability.

JInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable)
Creates a JInternalFrame with the specified title, resizability, closability, maximizability

East way to study Java :: JFrame

Java Swing Tutorial Explaining the JFrame class. The components added to the frame are referred to as its contents; these are managed by the contentPane. To add a component to a JFrame, we must use its contentPane instead.JFrame is a Window with border, title and buttons. When JFrame is set visible, an event dispatching thread is started. JFrame objects store several objects including a Container object known as the content pane. To add a component to a JFrame, add it to the content pane.

JFrame Features

It’s a window with title, border, (optional) menu bar and user-specified components.
It can be moved, resized, iconified.
It is not a subclass of JComponent.
Delegates responsibility of managing user-specified components to a content pane, an instance of JPanel.

Centering JFrame’s

By default, a Jframe is displayed in the upper-left corner of the screen. To display a frame
at a specified location, you can use the setLocation(x, y) method in the JFrame class. This
method places the upper-left corner of a frame at location (x, y).

The Swing API keeps improving with abstractions such as the setDefaultCloseOperation method
for the JFrame

Crating a JFrame Window

Step 1: Construct an object of the JFrame class.

Step 2: Set the size of the Jframe.

Step 3: Set the title of the Jframe to appear in the title bar (title bar will be blank if no title is set).

Step 4: Set the default close operation. When the user clicks the close button, the program stops running.

Step 5: Make the Jframe visible.

How to position JFrame on Screen?

frame.setLocationRelativeTo( null );

JFrame Source Code

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class JFrameDemo {

public static void main(String s[]) {
JFrame frame = new JFrame("JFrame Source Demo");
// Add a window listner for close button
frame.addWindowListener(new WindowAdapter() {

public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
// This is an empty content area in the frame
JLabel jlbempty = new JLabel("");
jlbempty.setPreferredSize(new Dimension(175, 100));
frame.getContentPane().add(jlbempty, BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
}
}

Output

Java JFrame Hierarchy

javax.swing
Class JFrame
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, RootPaneContainer, Serializable, WindowConstants

JFrame Constructor

JFrame()
Constructs a new frame that is initially invisible.

JFrame(GraphicsConfiguration gc)
Creates a Frame in the specified GraphicsConfiguration of a screen device and a blank title.

JFrame(String title)
Creates a new, initially invisible Frame with the specified title.

JFrame(String title, GraphicsConfiguration gc)
Creates a JFrame with the specified title and the specified GraphicsConfiguration of a screen device.

Easy way to study JAVA :: Swing

What is Swings in java ?

  • A part of The JFC
  • Swing Java consists of
    Look and feel
    Accessibility
    Java 2D
    Drag and Drop, etc
  • Compiling & running programs
  • if you do not explicitly add a GUI component to a container, the GUI component will not be displayed when the container appears on the screen.

Swing Model/view design: The “view part” of the MV design is implemented with a component object and the UI object. The “model part” of the MV design is implemented by a model object and a change listener object

Swing is built on top of AWT and is entirely written in Java, using AWT’s lightweight component support. In particular, unlike AWT, t he architecture of Swing components makes it easy to customize both their appearance and behavior. Components from AWT and Swing can be mixed, allowing you to add Swing support to existing AWT-based programs. For example, swing components such as JSlider, JButton and JCheckbox could be used in the same program with standard AWT labels, textfields and scrollbars. You could subclass the existing Swing UI, model, or change listener classes without having to reinvent the entire implementation. Swing also has the ability to replace these objects on-the-fly.

  • 100% Java implementation of components
  • Pluggable Look & Feel
  • Lightweight components
  • Uses MVC Architecture
    Model represents the data
    View as a visual representation of the data
    Controller takes input and translates it to changes in data
  • Three parts
    Component set (subclasses of JComponent)
    Support classes
    Interfaces

In Swing, classes that represent GUI components have names beginning with the letter J. Some examples are JButton, JLabel, and JSlider. Altogether there are more than 250 new classes and 75 interfaces in Swing — twice as many as in AWT.

Java Swing class hierarchy

The class JComponent, descended directly from Container, is the root class for most of Swing’s user interface components.

Swing contains components that you’ll use to build a GUI. I am listing you some of the commonly used Swing components. To learn and understand these swing programs, AWT Programming knowledge is not required.

Java Swing Examples

Below is a java swing code for the traditional Hello World program.

Basically, the idea behind this Hello World program is to learn how to create a java program, compile and run it. To create your java source code you can use any editor( Text pad/Edit plus are my favorites) or you can use an IDE like Eclipse.

import javax.swing.JFrame;
import javax.swing.JLabel;

//import statements
//Check if window closes automatically. Otherwise add suitable code
public class HelloWorldFrame extends JFrame {

public static void main(String args[]) {
new HelloWorldFrame();
}
HelloWorldFrame() {
JLabel jlbHelloWorld = new JLabel("Hello World");
add(jlbHelloWorld);
this.setSize(100, 100);
// pack();
setVisible(true);
}
}

Output

Note: Below are some links to java swing tutorials that forms a helping hand to get started with java programming swing.

  • JPanel is Swing’s version of the AWT class Panel and uses the same default layout, FlowLayout. JPanel is descended directly from JComponent.
  • JFrame is Swing’s version of Frame and is descended directly from that class. The components added to the frame are referred to as its contents; these are managed by the contentPane. To add a component to a JFrame, we must use its contentPane instead.
  • JInternalFrame is confined to a visible area of a container it is placed in. It can be iconified , maximized and layered.
  • JWindow is Swing’s version of Window and is descended directly from that class. Like Window, it uses BorderLayout by default.
  • JDialog is Swing’s version of Dialog and is descended directly from that class. Like Dialog, it uses BorderLayout by default. Like JFrame and JWindow,
    JDialog contains a rootPane hierarchy including a contentPane, and it allows layered and glass panes. All dialogs are modal, which means the current
    thread is blocked until user interaction with it has been completed. JDialog class is intended as the basis for creating custom dialogs; however, some
    of the most common dialogs are provided through static methods in the class JOptionPane.
  • JLabel, descended from JComponent, is used to create text labels.
  • The abstract class AbstractButton extends class JComponent and provides a foundation for a family of button classes, including
    JButton.
  • JTextField allows editing of a single line of text. New features include the ability to justify the text left, right, or center, and to set the text’s font.
  • JPasswordField (a direct subclass of JTextField) you can suppress the display of input. Each character entered can be replaced by an echo character.
    This allows confidential input for passwords, for example. By default, the echo character is the asterisk, *.
  • JTextArea allows editing of multiple lines of text. JTextArea can be used in conjunction with class JScrollPane to achieve scrolling. The underlying JScrollPane can be forced to always or never have either the vertical or horizontal scrollbar;
    JButton is a component the user clicks to trigger a specific action.
  • JRadioButton is similar to JCheckbox, except for the default icon for each class. A set of radio buttons can be associated as a group in which only
    one button at a time can be selected.
  • JCheckBox is not a member of a checkbox group. A checkbox can be selected and deselected, and it also displays its current state.
  • JComboBox is like a drop down box. You can click a drop-down arrow and select an option from a list. For example, when the component has focus,
    pressing a key that corresponds to the first character in some entry’s name selects that entry. A vertical scrollbar is used for longer lists.
  • JList provides a scrollable set of items from which one or more may be selected. JList can be populated from an Array or Vector. JList does not
    support scrolling directly, instead, the list must be associated with a scrollpane. The view port used by the scroll pane can also have a user-defined
    border. JList actions are handled using ListSelectionListener.
  • JTabbedPane contains a tab that can have a tool tip and a mnemonic, and it can display both text and an image.
  • JToolbar contains a number of components whose type is usually some kind of button which can also include separators to group related components
    within the toolbar.
  • FlowLayout when used arranges swing components from left to right until there’s no more space available. Then it begins a new row below it and moves
    from left to right again. Each component in a FlowLayout gets as much space as it needs and no more.
  • BorderLayout places swing components in the North, South, East, West and center of a container. You can add horizontal and vertical gaps between
    the areas.
  • GridLayout is a layout manager that lays out a container’s components in a rectangular grid. The container is divided into equal-sized rectangles,
    and one component is placed in each rectangle.
  • GridBagLayout is a layout manager that lays out a container’s components in a grid of cells with each component occupying one or more cells,
    called its display area. The display area aligns components vertically and horizontally, without requiring that the components be of the same size.
  • JMenubar can contain several JMenu’s. Each of the JMenu’s can contain a series of JMenuItem ’s that you can select. Swing provides support for
    pull-down and popup menus.
  • Scrollable JPopupMenu is a scrollable popup menu that can be used whenever we have so many items in a popup menu that exceeds the screen visible height.

    Java Swing Projects

  • Java Swing Calculator developed using Java Swing. It is a basic four-function calculator java program source code.
  • Java Swing Address Book demonstrates how to create a simple free address book program using java swing and jdbc. Also you will learn to use
    the following swing components like Jbuttons, JFrames, JTextFields and Layout Manager (GridBagLayout).

Saturday, September 5, 2009

Why Web Services are needed in Industry

Basically Web services mitigate the application integration crisis. It helps integrating applications at a significantly lower price point than any other integration technology.

It’s a new kind of middleware based on XML and the Web. XML and the Web help solve the challenges associated with traditional application-to-application integration like heterogeneity. They are platform and language independent.

Web Services has following advantages:

  1. Exposing your API onto a network Connecting Different Applications
  2. Low Cost of communication
  3. Support for Loosely Coupled Applications
  4. Web Services are Self Describing using WSDL
  5. Automatic Discovery using UDDI
  6. Business Opportunity to grow your business