Friday, 20 September 2013

How to make a Assignment File and How to write the answers of case Studies in Theory papers.

Hi Readers,

In this article I want to tell you how to make a assignment file by taking an example of one Java Program.

                
Ans 1.                                                    DESIGN VIEW


OBJECT  NAMING CONVENTION TABLE
Object Name
Object Type
Description
jTextField1
Text Box Control
Used to take first number at run time.
jTextField2
Text Box Control
Used to take second number at run time.
jLabel1
Label Control
Used to display caption in front of first number text box.
jLabel2
Label Control
Used to display caption in front of second number text box.
jButton1
Command Button
Used to find greater among given numbers.
jButton2
Command Button
Used to Clear both text boxes
Coding of the Problem
Coding of Clear command button
Event is jButton1ActionPerformed
                             
        jTextField1.setText(" ");
        jTextField2.setText(" ");

Coding of Click me command button
Event is jButton1ActionPerformed
       int a,b;
       a=Integer.parseInt(jTextField1.getText());
       b=Integer.parseInt(jTextField2.getText());
       if(a>b)
       {
           JOptionPane.showMessageDialog(null, "First number is greater ");
       }
       else
       {
           JOptionPane.showMessageDialog(null,"Second number is greater");
       }
     
Run View


2 comments: