Header Ads

Header ADS

resume

 import javax.swing.*;

import java.awt.*;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;


public class StudentResumeApp {

    private JFrame frame;

    private JTextField nameField, emailField;

    private JTextArea resumeTextArea;


    public StudentResumeApp() {

        frame = new JFrame("Student Resume App");

        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        frame.setSize(400, 300);


        JPanel panel = new JPanel();

        panel.setLayout(new GridLayout(4, 2));


        JLabel nameLabel = new JLabel("Name:");

        nameField = new JTextField(20);

        JLabel emailLabel = new JLabel("Email:");

        emailField = new JTextField(20);

        JLabel resumeLabel = new JLabel("Resume:");

        resumeTextArea = new JTextArea(10, 20);

        JScrollPane resumeScrollPane = new JScrollPane(resumeTextArea);


        JButton submitButton = new JButton("Submit");

        submitButton.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {

                String name = nameField.getText();

                String email = emailField.getText();

                String resume = resumeTextArea.getText();


                // You can process the submitted data here, e.g., save it to a file or a database.

                // For this example, we'll just display the data.

                String message = "Name: " + name + "\nEmail: " + email + "\nResume:\n" + resume;

                JOptionPane.showMessageDialog(frame, message, "Submitted Resume", JOptionPane.PLAIN_MESSAGE);

            }

        });


        panel.add(nameLabel);

        panel.add(nameField);

        panel.add(emailLabel);

        panel.add(emailField);

        panel.add(resumeLabel);

        panel.add(resumeScrollPane);

        panel.add(new JLabel()); // Empty label for spacing

        panel.add(submitButton);


        frame.add(panel);

        frame.setVisible(true);

    }


    public static void main(String[] args) {

        SwingUtilities.invokeLater(new Runnable() {

            public void run() {

                new StudentResumeApp();

            }

        });

    }

}


No comments

Powered by Blogger.