Powered by Blogger.

Contact

Popular Posts

Monday 29 July 2013

By
JavaScript libraries have made huge leaps and bounds in helping developers write code and develop products more quickly. jQuery is one of the most popular JavaScript frameworks, with powerful tools that improve the user’s interaction with Web applications. jQuery has an additional advantage in that it allows developers to select elements on a page using CSS-like syntax. To help you take it up a notch, we share below some methods that can help you give visitors to your website an amazing user experience. Here are over 45 impressive jQuery plug-ins and techniques that have been recently created and that could make the development of your next website an easier and more interesting experience than the last. You may want to take a look at the following related posts:

Dynamic Content

1. Build A Login Form With jQueryIn this tutorial, we'll create a sliding panel, that slides in to reveal more content, using JQuery to animate the height of the panel. In this case, we will be creating a hypothetical login for the new tutsplus area that's coming soon. jQuery 2. Spoiler Revealer with jQueryA simple technique that hides some content first and fades it in once a link is clicked. jQuery 3. AJAX UploadThis AJAX file upload plug-in allows users to easily upload multiple files without having to refresh the page. In addition, you can use any element to trigger the file selection window. The plug-in creates a semi-transparent file input screen over the button you specify, so when a user clicks on the button, the normal file selection window is shown. After the user selects a file, the plug-in submits the form that contains the file input to an iFrame. So it isn’t true AJAX but provides the same user experience. jQuery 4. FCBKcompleteGive your users fancy Facebook-like dynamic inputs, with auto-complete and pre-added values. jQuery 5. Create Accessible Charts Using Canvas and jQueryThis tool is proof that you can use the <canvas> element to illustrate HTML table data. The idea is a good one: putting the data in a table allows it to remain accessible, while the chart can be shown for visual enhancement. jQuery

Form Manipulation

6. Radio Button and Check Box ReplacementThis jQuery tool replaces radio buttons and check boxes with a more appealing display. jQuery 7. Submit a Form without a Page Refresh jQuery 8. jQuery AJAX Contact FormHere is a quick and easy way to make a jQuery AJAX contact form with a “honeypot” to foil email bots, load success and error messages dynamically without leaving the page and provide descriptive error messages detailing why submitted values have failed validation. jQuery 9. Simple jQuery Form ValidationThis jQuery form shows live form-input validators both server-side and browser-side. jQuery

Navigation Menus

10. jQuery Context MenuA context menu plug-in for jQuery that features easy implementation, keyboard shortcuts, CSS styling and control methods. jQuery 11. Kwicks for jQueryKwicks for jQuery started off as a port of the incredibly attractive MooTools framework, but has evolved into a highly customizable and versatile widget. jQuery 12. jQuery iPod-style Drilldown Menu"We created an iPod-style drilldown menu to help users traverse hierarchical data quickly and with control. It's especially helpful when organizing large data structures that don't translate well into traditional dropdown or fly-out menus." jQuery 13. jQuery File TreeThe jQuery File Tree is a configurable AJAX file-browser plug-in for jQuery. You can create a customized, fully-interactive file tree with as little as one line of JavaScript code. jQuery 14. How to Create a MooTools Home Page-Inspired Navigation EffectIn this tutorial, you’ll recreate the same effect seen in MooTools’s menu, but in jQuery! jQuery 15. CSS Sprites2This tutorial demonstrates how to implement inline CSS Sprites2 using jQuery. jQuery

Manipulating Content

16. jQuery books widgetWith some custom JavaScript and jQuery magic you can create some interesting widgets. A good way to demonstrate this functionality is by building a browsable Amazon.com books widget. jQuery 17. Text Size SliderThis tutorial explains how to use a slider to control the text size of an article on a page. This lets the user control exactly the size that suits them, and is also a pretty impressive feature to have on a site. jQuery 18. PaginationCreate navigational elements: when you have a large number of items, you can group them into pages and present navigational elements that allow users to move from one page to another. jQuery 19. Coda-SliderAs with the last tool, groups items together using navigational elements that allow users to move from one page to another. jQuery 20. Creating a Slick Auto-Playing Featured-Content SliderIf you love the Coda-Slider plug-in for jQuery, then you will find this plug-in very useful for displaying lots of content in a small area. This nice plug-in adds some features not found in the original Coda-Slider, such as slowly cycling through panels, auto-playing different types of custom content. An arrow indicator serves as a visual indication of which panel you are currently viewing. jQuery
  • Demo can be found here.
  • Download files here.
21. haccordionA simple horizontal accordion plug-in for jQuery. jQuery

Tabular Data and Grids

22. Table Row Checkbox ToggleThis tool generically adds a toggle function to any table row you specify based on a CSS class name. It will, by default, toggle on any check boxes within that table row. jQuery 23. TablesorterTablesorter is a jQuery plug-in that turns a standard HTML table with <th> and <td> tags into a sortable table without the need for page refreshes. Tablesorter can successfully parse and sort many types of data, including linked data, in a cell. jQuery 24. TableEditorTableEditor provides flexible in-place editing of HTML tables. User-defined handler functions can easily be dropped in to update, for example, a data source via an AJAX request. jQuery 25. Scrollable HTML TableThis JavaScript code can be used to convert ordinary HTML tables into scrollable ones. jQuery

Lightbox Techniques

26. Revealing Photo SliderLearn how to create a thumbnail photo gallery, where clicking a button reveals the entire photo and more information about that photo. jQuery 27. FancyBoxFancyBox was born to automatically scale large images to fit in windows, adding a nice drop-shadow under the zoomed item. It can be used to group related items and add navigation between them (using a pre-loading function). FancyBox is totally customizable through settings and CSS. jQuery 28. Facebox Image and Content Viewer Facebox is a lightweight Facebook-style Lightbox that can display images, divs, and even entirely remote pages (via AJAX) inline on a page and on demand. It uses the compact jQuery library as its engine, unlike Lightbox v2.0, which uses Prototype. jQuery 29. jQuery.popeyejQuery.popeye is a plug-in that transforms an unordered list of images into a simple image gallery. When an image is clicked, it enlarges Lightbox-style. The images are displayed in a box with “Previous” and “Next” controls, and information about the images can be included. jQuery

Image Galleries and Viewers

30. Simple Controls GallerySimple Controls Gallery rotates and displays each image by fading it into view over the previous one, with navigation controls that pop up when the mouse hovers over the gallery. The controls allow the user to play, pause or jump to a specific image in the gallery. jQuery 31. Agile CarouselThis jQuery plug-in allows you to easily create a custom carousel. Use the jQuery UI to enable many different types of transition. The plug-in uses PHP to call images from the folder you specify. Configure many different options including controls, slide timer length, easing type, transition type and more! jQuery

Browser Tweaks

32. Setting Equal Heights with jQueryA script to equalize the heights of boxes within the same container and create a tidy grid. jQuery 33. jQuery IE6 PNG Transparency FixAnother IE6 PNG fix that uses jQuery selectors to automatically fix all PNG images on a page. 34. BGI frameThis tool helps ease the pain of dealing with IE z-index issues. You can find a demo here. 35. Fix OverflowIE puts scroll bars inside overflowing elements, and if an element is only one line, the scroll bar will cover it. This plug-in fixes that issue. jQuery 36. Lazy LoadLazy Load delays the loading of images below the fold on long pages. As the user scrolls down, the images are loaded as needed. Check out the demo here. 37. MaxlengthIt’s a fairly common design practice to limit the number of characters a user can input in a field while giving feedback on how many spaces are left. This plug-in automates that task. jQuery

Animation Effects

38. ScrollableScrollable is a flexible and lightweight (3.9 KB) jQuery plug-in for creating scrollable content. Scrollable items can contain any HTML, such as text, images, forms, video or any combination of them. You can make items scroll horizontally or vertically and decide how many items are visible at once. jQuery 39. jQuery Fading Menu - Replacing Content"Instead of thinking about CSS as page layout and a way to style your page when it loads, you can use in animation and change it on-the-fly to react to events that happen on your page. Take for example a menu. You can take the “click” event that happens when clicking on a menu to do lots of stuff." jQuery 40. Build an Animated Cartoon Robot with jQueryThis effect simulates a faux 3-D animated background reminiscent of old-school side-scrolling video games (and not unlike the parallax effect). This effect is created by layering several empty divs over each other, with transparent PNGs as background images. The backgrounds are animated at different speeds using jQuery. jQuery 41. FlipFlip is a plug-in for jQuery that “flips” page elements in four directions. Compatible with Firefox 2+, Internet Explorer 6+, Safari 3.1 (for Windows) and Google Chrome. jQuery
  • Download files here.
42. Use jQuery for Background Image AnimationsAnimate your menu whenever a user hovers over an item with this effect. jQuery

Image Manipulation

43. JcropJcrop is the quick and easy way to add image-cropping functionality to your Web application. It combines the ease of use of a typical jQuery plug-in with a powerful cross-platform DHTML cropping engine that is faithful to familiar desktop graphics applications. jQuery 44. jQZoomJQZoom is a JavaScript image magnifier that makes it really easy to magnify what you want. It is easy to customize and works on all modern browsers. jQuery

Miscellaneous

45. Date Range PickerA rich date-range widget that uses the jQuery UI’s date picker and some additional custom interaction. jQuery 46. Sortable ListsUnordered lists are commonly used to structure a website’s navigation. Having the ability to re-order such lists would be extremely useful. Here is a method to easily save and reload the list element order without getting lost as the page is refreshed. jQuery 47. Amazing Music Player Using Mouse Gestures and HotkeysLearn how to create an amazing music player, coded in XHTML and jQuery, that makes use of mouse gestures and hotkeys. You can click and drag the mouse to interact with the music player’s interface or use directional keys and the space bar instead of the mouse. jQuery 48. Script for Tracking Outbound Links in Google Analytics with jQueryThis code snippet uses Google Analytics and jQuery to automatically track outbound links. This interesting script enhances behavior by comparing the link’s domain to the current page’s domain and, if they are different, triggering the behavior. This is helpful when using a CMS or other tool that generates full URLs, including the “http://,” instead of relative ones.
<script type="text/javascript">
$('#content a:not(.popupwindow)').filter(function() {
var theHref = this;
if (theHref.hostname && theHref.hostname !== location.hostname) {
$(theHref).not(".noAutoIcon").addClass("offSite");
$(theHref).not(".noAutoLink").attr('target','_blank').bind('click keypress', function(event) {
var code=event.charCode || event.keyCode;
if (!code || (code && code == 13)) {
if(pageTracker){
var fixedLink = this.href;
fixedLink = fixedLink.replace(/https?:\/\/(.*)/,"$1");
fixedLink = '/outgoing/' fixedLink;
pageTracker._trackPageview(fixedLink);
};
};
});
};
});
</script>
49. jGrowljGrowl is a jQuery plug-in that delivers unobtrusive messages within the browser, similar to the way that OS X’s Growl Framework works. jQuery
/*
 * login_form.java
 *
 * Created on July 16, 2013, 10:57 AM
 */

package loginform;

/**
 *
 * @author  LTIET_CSE_DEPT
 */
public class login_form extends javax.swing.JFrame {
   
    /** Creates new form login_form */
    public login_form() {
        initComponents();
        jOptionPane1.setVisible(false);
    }
   
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        uname = new javax.swing.JTextField();
        ok = new javax.swing.JButton();
        cancel_btn = new javax.swing.JButton();
        upass = new javax.swing.JPasswordField();
        jOptionPane1 = new javax.swing.JOptionPane();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setText("Name:");

        jLabel2.setText("Password:");

        ok.setText("OK");
        ok.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                okActionPerformed(evt);
            }
        });

        cancel_btn.setText("Cancel");
        cancel_btn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancel_btnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(51, 51, 51)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(upass)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(ok)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(cancel_btn))
                            .addComponent(uname, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(84, 84, 84)
                        .addComponent(jOptionPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(242, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(36, 36, 36)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(uname, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(upass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(35, 35, 35)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ok)
                    .addComponent(cancel_btn))
                .addGap(28, 28, 28)
                .addComponent(jOptionPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(151, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void okActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okActionPerformed
        if(uname.getText().equals("Sagar"))
        {
            if(upass.getText().equals("123"))
            {
                jOptionPane1.showMessageDialog(this,"Welcome");
            }
            else{jOptionPane1.showMessageDialog(this,"Enter Correct Password");}
        }
        else{jOptionPane1.showMessageDialog(this,"Enter Correct UserName");}
    }//GEN-LAST:event_okActionPerformed

    private void cancel_btnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancel_btnActionPerformed
        System.exit(0);
    }//GEN-LAST:event_cancel_btnActionPerformed
   
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new login_form().setVisible(true);
            }
        });
    }
   
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton cancel_btn;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JOptionPane jOptionPane1;
    private javax.swing.JButton ok;
    private javax.swing.JTextField uname;
    private javax.swing.JPasswordField upass;
    // End of variables declaration//GEN-END:variables
   
}

Saturday 27 July 2013

  
package ajt;

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

class StudentReg extends JPanel implements ActionListener {
   
    JButton b1;
    JTextField t1,t2,t3;
    JLabel l1,l2,l3,l4;
    JCheckBox c1,c2,c3;
    JRadioButton r1,r2;
    ButtonGroup bg1;
    JComboBox cb;
    String str="Game : ";
    JCheckBox c[] = new JCheckBox[3];
    public StudentReg()
    {
        b1 = new JButton("Submit");
        t1 = new JTextField("Sagar",10);
        t2 = new JTextField("CE",10);
        t3 = new JTextField("Botad",10);
        l1 = new JLabel("Name");
        l2 = new JLabel("Branch");
        l3 = new JLabel("Address");
        l4 = new JLabel("Car");
        r1 = new JRadioButton("Male");
        r1.setActionCommand("male");
        r2 = new JRadioButton("Female");
        r2.setActionCommand("female");
        c1 = new JCheckBox("Cricket");
        c2 = new JCheckBox("FootBall");
        c3 = new JCheckBox("VollyBall");
        cb = new JComboBox();
        bg1 = new ButtonGroup();
       
        cb.addItem("BMW");
        cb.addItem("AUDI");
        cb.addItem("AMW");
       
        b1.addActionListener(this);
        bg1.add(r1);
        bg1.add(r2);
       
        add(l1);
        add(t1);
        add(l2);
        add(t2);
        add(l3);
        add(t3);   
        add(l4);
        add(cb);
        add(r1);add(r2);
        add(c1);add(c2);add(c3);
        add(b1);
   
    }
   public void actionPerformed(ActionEvent e)
   {
       String name = t1.getText();
       System.out.println("Name : "+name);
       String branch = t2.getText();
       System.out.println("Branch : "+branch);
       String add = t3.getText();
       System.out.println("Address : "+add);
      
       String car = cb.getSelectedItem().toString();
       System.out.println("Car : "+car);
       if(bg1.getSelection().getActionCommand().equals("male"))
       {
            System.out.println("Gender : Male");
       }
       else
       {
            System.out.println("Gender : Female");
       }
      
        if(c1.isSelected())
        { 
           str = str +"Cricket ";
          
        }
        if(c2.isSelected())
        {
           str = str+"+ FootBall";   
          
        }
        if(c3.isSelected())
        {
            str = str+ "+ VollyBall ";         
        }
        System.out.println(" "+str);
   }
   public static void main(String args[])
   {
        JFrame frame = new JFrame("JButtonDemo");
   
        frame.addWindowListener(new WindowAdapter()
        {
            public void windowClosing(WindowEvent e)
            {
                System.exit(0);
            }
        });
        frame.getContentPane().add(new StudentReg());
        frame.pack();
        frame.setVisible(true);
   }
}

package ajt;

/**
 *
 * @author  SAGAR
 */
public class StudentRegForm extends javax.swing.JFrame {

    /** Creates new form StudentRegForm */
    public StudentRegForm() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jRadioButton1 = new javax.swing.JRadioButton();
        jRadioButton2 = new javax.swing.JRadioButton();
        jTextField1 = new javax.swing.JTextField();
        jTextField2 = new javax.swing.JTextField();
        jTextField3 = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jButton1 = new javax.swing.JButton();
        jCheckBox1 = new javax.swing.JCheckBox();
        jCheckBox2 = new javax.swing.JCheckBox();
        jCheckBox3 = new javax.swing.JCheckBox();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setText("Name");

        jLabel2.setText("Branch");

        jLabel3.setText("Address");

        jRadioButton1.setText("Male");

        jRadioButton2.setText("Female");

        jTextField1.setToolTipText("");

        jLabel4.setText("State");

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Cars", "Bike", "Bicycle" }));
        jComboBox1.setToolTipText("");

        jButton1.setText("jButton1");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jCheckBox1.setText("Cricket");

        jCheckBox2.setText("FootBall");

        jCheckBox3.setText("VollyBall");

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jTable1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 345, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 52, Short.MAX_VALUE))
                            .addComponent(jLabel4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jComboBox1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jTextField2)
                                    .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 113, Short.MAX_VALUE)
                                    .addComponent(jTextField3, javax.swing.GroupLayout.Alignment.TRAILING))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jCheckBox3)
                                    .addComponent(jCheckBox2)
                                    .addComponent(jCheckBox1)))
                            .addComponent(jButton1)))
                    .addComponent(jRadioButton2)
                    .addComponent(jRadioButton1))
                .addContainerGap(344, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(24, 24, 24)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jRadioButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jRadioButton2))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(17, 17, 17)
                        .addComponent(jCheckBox1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jCheckBox2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jCheckBox3)))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 29, Short.MAX_VALUE)
                .addComponent(jButton1)
                .addGap(79, 79, 79))
        );

        pack();
    }// </editor-fold>
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
        String name = jTextField1.getText();
        System.out.println("Name : " + name);
        String branch = jTextField2.getText();
        System.out.println("Branch : " + branch);
        String address = jTextField3.getText();
        System.out.println("Address : " + address);

        String s = jComboBox1.getSelectedItem().toString();
        System.out.println("State : "+ s);
      
       jCheckBox1.getSelectedObjects().toString();
      
      
    }                                       

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new StudentRegForm().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JButton jButton1;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JCheckBox jCheckBox2;
    private javax.swing.JCheckBox jCheckBox3;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTable1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    // End of variables declaration
}
  1. import javax.swing.JFrame;  
  2. import javax.swing.JCheckBox;  
  3. import javax.swing.JButton;  
  4. import javax.swing.JOptionPane;  
  5.   
  6. import java.awt.GridLayout;  
  7.   
  8. import java.awt.event.ActionEvent;  
  9. import java.awt.event.ActionListener;  
  10.   
  11. public class GetSelectedJCheckBox implements ActionListener  
  12. {  
  13. //Create String that will be use to hold selected JCheckBox text  
  14. String selectedCheckBox="";  
  15.   
  16. //Create check box using JCheckBox  
  17. JCheckBox checkBox1=new JCheckBox("Duck");  
  18. JCheckBox checkBox2=new JCheckBox("Chicken");  
  19. JCheckBox checkBox3=new JCheckBox("Cow");  
  20. JCheckBox checkBox4=new JCheckBox("Sheep");  
  21.   
  22. //Create button using JButton with text ( Get selected JCheckBox )  
  23. JButton button=new JButton("Get selected JCheckBox");  
  24.   
  25. //method actionPerformed that we override because we implement ActionListener  
  26. public void actionPerformed(ActionEvent event)  
  27. {  
  28.  //Action for button  
  29.  if(event.getSource()==button)  
  30.  {  
  31.   //Check first JCheckBox is selected or not  
  32.   if(checkBox1.isSelected())  
  33.   {  
  34.    selectedCheckBox=selectedCheckBox+checkBox1.getText()+"\n";  
  35.   }  
  36.    
  37.   //Check second JCheckBox is selected or not  
  38.   if(checkBox2.isSelected())  
  39.   {  
  40.    selectedCheckBox=selectedCheckBox+checkBox2.getText()+"\n";  
  41.   }  
  42.    
  43.   //Check third JCheckBox is selected or not  
  44.   if(checkBox3.isSelected())  
  45.   {  
  46.    selectedCheckBox=selectedCheckBox+checkBox3.getText()+"\n";  
  47.   }  
  48.    
  49.   //Check fourth JCheckBox is selected or not  
  50.   if(checkBox4.isSelected())  
  51.   {  
  52.    selectedCheckBox=selectedCheckBox+checkBox4.getText()+"\n";  
  53.   }  
  54.    
  55.   //Show message that tell you, what check box that you selected  
  56.   JOptionPane.showMessageDialog(null,"Selected check box is : \n"+selectedCheckBox);  
  57.    
  58.   //Make selectedCheckBox string like initial with empty string  
  59.   selectedCheckBox=new String("");  
  60.  }  
  61. }  
  62.   
  63. //Constructor  
  64. public GetSelectedJCheckBox()  
  65. {  
  66.  //Create a window using JFrame with title ( Get selected JCheckBox )  
  67.  JFrame frame=new JFrame("Get selected JCheckBox");  
  68.   
  69.  //Create layout that will be use by JFrame  
  70.  GridLayout gl=new GridLayout(5,1);  
  71.   
  72.  //Add ActionListener to button  
  73.  button.addActionListener(this);  
  74.   
  75.  //Set JFrame layout  
  76.  frame.setLayout(gl);  
  77.   
  78.  //Add all created check box into JFrame  
  79.  frame.add(checkBox1);  
  80.  frame.add(checkBox2);  
  81.  frame.add(checkBox3);  
  82.  frame.add(checkBox4);  
  83.   
  84.  //Add created button into JFrame  
  85.  frame.add(button);  
  86.   
  87.  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
  88.  frame.setSize(350,200);  
  89.  frame.setVisible(true);  
  90. }  
  91.   
  92. //Main method  
  93. public static void main(String[]args)  
  94. {  
  95.  GetSelectedJCheckBox gsjcb=new GetSelectedJCheckBox();  
  96. }  

Friday 19 July 2013

Engineering Books
Link :http://www.gobookee.net/
http://www.generalfiles.org/