Вы находитесь на странице: 1из 10

ABC Consultancy is a placement organization,

assists job seekers. The Entry form has to be


designed to facilitate the Registration Process with
following features.
1. When Submit button is pressed, the following things should
happen.
a)
b)
c)

If Post Graduate is checked, the 10+2 & Graduate checkboxes should also get
selected automatically.
If Graduate is checked, the 10+2 checkbox should also get selected.
A Message Box with Hello Mr. .. you are registered or Hello Miss .. you are
registered as per Gender of candidate.

2. When Clear Button is pressed, all the text boxes, check boxes get
cleared, & Male and Science option is selected by default.

import javax.swing.JOptionPane;
private void submitBTNActionPerformed(java.awt.event.ActionEvent evt) {
String str ="Miss ",name=nameTF.getText();
if(postgradCB.isSelected()){
gradCB.setSelected(true);
tenplusCB.setSelected(true);
}
if(gradCB.isSelected())
tenplusCB.setSelected(true);
if(maleRB.isSelected())
if(maleRB.isSelected())
str="Mr.";
JOptionPane.showMessageDialog(this,"Hello "+str+name+"!! You are registered.");// TODO add your handling
code here:
}
private void clearBTNActionPerformed(java.awt.event.ActionEvent evt) {
nameTF.setText(null);
sciRB.setSelected(true);
maleRB.setSelected(true);
tenplusCB.setSelected(false);
gradCB.setSelected(false);
postgradCB.setSelected(false);// TODO add your handling code here:
}

The Milton Casting Company has developed an


application to calculate the wage of its workers. The
following functionalities are expected.
1. The Wage rate are Rs. 150/- (per day) for male & Rs. 130/- for
females.

2. An additional amount Rs. 50/- per day is paid if worker is skilled.


3. When Calculate Button is clicked the Total wage amount is
calculated & displayed in relevant Text box.

4. When Clear Button is clicked, all the text boxes get cleared & Male
option is selected.

private void calBTNActionPerformed(java.awt.event.ActionEvent evt) {


double amt=130,noofdays=Double.parseDouble(noofdaysTF.getText());
if(maleRB.isSelected())
amt=150;
if(skilledCB.isSelected())
amt+=50;
amtTF.setText("Rs. "+(amt*noofdays));// TODO add your handling code here:
}
private void clearBTNActionPerformed(java.awt.event.ActionEvent evt) {
nameTF.setText(null);
noofdaysTF.setText(null);
amtTF.setText(null);
maleRB.setSelected(true);
skilledCB.setSelected(false);// TODO add your handling code here:
}

The Fashion Gallery-a leading garments shop wants


to develop an application to calculate the discount
amount. The following functionalities are expected.
1. The discount is given on the basis on payment mode.
Cash - 10%, Cheque - 8% & Credit - 5% of bill amount.
If Bill amount is more than 10,000 then additional 5% discount is
also given.

2. Initially, Calculate Net Amount is disabled, but when user click on


Calculate Discount button the discount amount is calculated &
displayed, & Calculate Net Amount Button is enabled.

3. When Calculate Net Amount is clicked the Net Amount is calculated


& displayed in Net Amount Text Box.

4. When Exit Button is clicked, a Confirm dialog appears & application


is closed only when Yes option in confirm dialog is selected.

import javax.swing.JOptionPane;
private void caldiscountBTNActionPerformed(java.awt.event.ActionEvent evt) {
int index=modeCB.getSelectedIndex();
double discount=0.05,billamt=Double.parseDouble(billamtTF.getText());
if(index==0)
discount=0.1;
if(index==1)
discount=0.08;
if(billamt>10000)
discount+=0.05;
discountTF.setText(""+(discount*billamt));
calnetamtBTN.setEnabled(true);// TODO add your handling code here:
}
private void calnetamtBTNActionPerformed(java.awt.event.ActionEvent evt) {
double billamt=Double.parseDouble(billamtTF.getText());
double discount=Double.parseDouble(discountTF.getText());
netamtTF.setText(""+(billamt-discount));// TODO add your handling code here:
}
private void exitBTNActionPerformed(java.awt.event.ActionEvent evt) {
int ans=JOptionPane.showConfirmDialog(this,"Are you sure you want to exit?");
if(ans==0)
System.exit(0);// TODO add your handling code here:
}

The Entertainment Paradise-A theater in Delhi


wants to develop a computerized Booking System.
The proposed Interface is given below. The theater
offers different types of seats. The Ticket rates areStalls-Rs. 625/-, Circle-Rs. 750/-, Upper Class-Rs.
850/- & Box-Rs. 1000/-.
A discount is given 10% of total amount if tickets are
purchased on Cash. In case of credit card holders 5%
discount is given.

import javax.swing.JOptionPane;
private void closeBTNActionPerformed(java.awt.event.ActionEvent evt) {
int ans=JOptionPane.showConfirmDialog(this,"Are you sure you want to exit?");
if(ans==0)
System.exit(0);// TODO add your handling code here:
}
private void calBTNActionPerformed(java.awt.event.ActionEvent evt) {
double rate=1000,discount=0.05;
int seat=Integer.parseInt(seatsTF.getText());
if(stallsRB.isSelected())
rate=625;
else if(circleRB.isSelected())
rate=750;
else if(upclassRB.isSelected())
rate=850;
if(cashRB.isSelected())
discount=0.1;
totalamtTF.setText("Rs. "+(rate*seat));
discountTF.setText("Rs. "+(rate*seat*discount));
netamtTF.setText("Rs. "+(rate*seat*(1-discount)));// TODO add your handling code here:
}

Develop an application as per given screen shot to


Add, Remove the given members of list & display the
selected item in a text field using List control.

import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
private void clearlistBTNActionPerformed(java.awt.event.ActionEvent evt) {
colorL.removeAll();// TODO add your handling code here:
}
private void closeBTNActionPerformed(java.awt.event.ActionEvent evt) {
int ans=JOptionPane.showConfirmDialog(this,"Are you sure you want to exit?");
if(ans==0)
System.exit(0);// TODO add your handling code here:
}
private void addBTNActionPerformed(java.awt.event.ActionEvent evt) {
DefaultListModel model=(DefaultListModel)colorL.getModel();
String add=addTF.getText();
model.addElement(add);// TODO add your handling code here:
}
private void removeBTNActionPerformed(java.awt.event.ActionEvent evt) {
DefaultListModel model=(DefaultListModel)colorL.getModel();
String remove=removeTF.getText();
model.removeElement(remove);// TODO add your handling code here:
}
private void colorLValueChanged(javax.swing.event.ListSelectionEvent evt) {
selectionTF.setText(colorL.getSelectedValue());// TODO add your handling code here:
}

Вам также может понравиться