Question

Write a Java applet that accepts grams as input and displays its quintal, kilogram and milligram equivalent, as per the choice of user.

15 Sep 2024
Answer :
Word Count : 684

Java applet that allows users to input grams and select the conversion they want to perform (to quintals, kilograms, or milligrams). The applet uses a simple GUI with radio buttons for the conversion choices and a text field for input. 


import java.applet.Applet;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class ConversionApplet extends Applet implements ActionListener {
    TextField inputField;
    Button convertButton;
    Label resultLabel;
    CheckboxGroup conversionGroup;
    Checkbox quintalCheckbox, kilogramCheckbox, milligramCheckbox;

    public void init() {
        setLayout(new GridLayout(5, 1));

        // Input Field
        add(new Label("Enter grams:"));
        inputField = new TextField();
        add(inputField);

        ______ ____ ___ ________ ___ ____ ____ _________ _____ __________.
______ ______ _________ ___ ___ ______ __________.
__________ _____ ______ _____ ____ _________ ___ ______ ___ ____ ____.
_________ _____ ______ ___ _____ ___ ___ ____ ________ _______ ______.
__________ ________ _____ __________ ________ ________ ____ _________ ________ _________.
_____ ______ __________ ______ __________.
______ ______ ____ ___ _______ _______ ________ ___ ___ ________.
_____ ___ ____ _______ __________ ___ __________ __________ ____.
____ __________ __________ __________ _________ _________.
___ __________ ______ _______ ____ ________.
__________ ________ __________ __________ __________ ______ ______ _______.
_____ ______ ____ _______ ______ _______ ________ ____ __________ _______ _____.
____ ________ ______ ____ _________ ____ ___.
___ _________ _________ ____ _______ __________ ____ _________ __________ _____.
_______ __________ ____ _______ __________ ________ _________ ____ ______ __________.
___ ___ ____ _______ ___ _________ ______ ______ _______.
______ ________ ____ ___ _________ _________ _______ _________ ___ _____ __________ _________.
_________ _________ _________ __________ _______ _____ ______ _____ _________ ______ ____.
_______ ______ ____ ____ _____ _________ _______ _______ ___ _____ _____ _______.
_____ _________ ___ ___ ______ _________ _____ __________ _______.
________ _______ ___ ______ ____.
________ _______ __________ __________ ______ ________ _____ ____ _______ ________ ________ _______.
___ ______ ___ ________ ___ _________ _______ _________ ________ ___ ____ ___.
______ ____ ______ ______ ________ ___ _________ __________ ________ ________ _____.
____ ____ ______ __________ ________ ______.
_______ ___ _____ _______ ________ _____ ___ __________.
___ ________ _________ ________ ___ _______ __________.
_______ ___ _____ _____ _____ ______ ________.
______ _______ _____ __________ ________ ___ __________ ______ ______ __________ __________.
________ ________ ____ _____ _______ ______ _______ _______ __________ ______.
_____ __________ ________ ______ ___.
__________ _____ ________ _________ __________.
__________ ________ ______ _______ ______ ________ ___ ____ ______ _________.
____ ____ ___ __________ ___ __________ ______ __________ ____ _______.
____ _________ ____ _______ __________ _________ ___ ________ ______ ______ ____.
________ _______ ____ _______ _______ _________.
___ ______ ____ __________ _________ ____ _________ ______ _______ __________ __________ _________.
_____ ___ ___ ______ ______ __________ ______ _______ _____.
______ _______ ___ __________ _________ ___ _________.
____ _______ _________ _______ _______ _________ _______ ____ _____ _____.
_______ ____ _________ ___ __________ __________ __________ ___.
_____ ________ _____ ________ _______ _____ ____ ____ ____.
_____ ___ ___ ______ ________ ______.
___ ____ _____ ______ ___ ___ _________ ___.
____ ______ _____ ____ _____ ____ _________ _______.
________ ___ _________ _____ __________ _______ ___.
_________ ____ _____ ________ ____ _________ __________ _________ __________ ____ _______ ___.
____ __________ _______ _____ _________ __________ _______.
___ _______ __________ __________ ____ ________ _____.
___ _______ __________ ________ ____ _____ _______.
_____ _____ ____ ______ ___ _____ ____ ______ ____ __________ ________ _____.
_____ ________ ________ __________ ___ ________ _______ ______ __________ _________.
_______ _____ ______ _______ ____ ____ _____ ____ ________.
_________ _________ __________ ________ _________ ___ _____ __________ _________.
____ ______ ____ ______ ___ ________ ________.
_______ _____ ______ ___ ___ _________ _________.
_____ _____ _____ ___ _____ ______ __________ ______ __________ ______ ______ _________.
____ _______ ___ _______ _____ ______.
__________ ___ __________ ________ ______ ______ _________ ____ ___ ____ ____ _____.
____ ____ _______ ___ ___ ___ ___ ________ __________ ___ _________ _____.
____ ____ __________ ___ _________ ___.
__________ ____ ________ ________ __________ ________ ______ _____.
_____.
Get Full Answer on WhatsApp

IGNOU NEWS
Assignment Submission Last Date Extended Till 30 June 2026 Click Here★★★IGNOU June 2026 TEE Date Sheet Released Click Here★★★
Top
📞
Call Support Instant phone assistance Write a Java applet that accepts grams as input and displays its quint
🟢
WhatsApp Chat Fast live messaging
Email Us Business enquiries & support