Please comment if you have any doubts or if want any modifications. Below code provides the exact output with main method also for reference I have uploading the screenshots of the program.
Code:-
/// Test.java ///
import java.io.*;
import java.util.*;
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
public class Test
{
public static void main(String[] args)
{
JFrame frame=new
JFrame("Input");
frame.setSize(400,400);
JLabel name=new JLabel("Name :
");
JLabel age=new JLabel("Age :
");
JLabel id=new JLabel("ID :
");
name.setBounds(100,30,100,30);
age.setBounds(100,80,100,30);
id.setBounds(100,130,100,30);
frame.add(name);
frame.add(age);
frame.add(id);
JTextField t1=new
JTextField();
JTextField t2=new
JTextField();
JTextField t3=new
JTextField();
t1.setBounds(150,30,100,30);
t2.setBounds(150,80,100,30);
t3.setBounds(150,130,100,30);
frame.add(t1);
frame.add(t2);
frame.add(t3);
JButton show_info=new JButton("Show
Info");
JButton modify=new
JButton("Modify");
JButton close=new
JButton("Close");
show_info.setBounds(30,180,100,30);
modify.setBounds(140,180,100,30);
close.setBounds(250,180,100,30);
frame.add(show_info);
frame.add(modify);
frame.add(close);
JTextArea text_area=new
JTextArea();
text_area.setBounds(45,240,300,100);
frame.add(text_area);
show_info.addActionListener(new
ActionListener()
{
public void
actionPerformed(ActionEvent e)
{
String a=t1.getText();
String b=t2.getText();
String c=t3.getText();
if(a.equals("") || b.equals("") ||
c.equals(""))
{
JOptionPane.showMessageDialog(frame,"Enter All Fields
!!!","Warning",JOptionPane.WARNING_MESSAGE);
}
else
{
String display="Name :
"+a+"\n"+"Age : "+b+"\n"+"ID : "+c;
text_area.setText(display);
}
}
});
modify.addActionListener(new
ActionListener()
{
public void
actionPerformed(ActionEvent e)
{
String a=t1.getText();
String b=t2.getText();
String c=t3.getText();
if(a.equals("") || b.equals("") ||
c.equals(""))
{
JOptionPane.showMessageDialog(frame,"Enter All Fields
!!!","Warning",JOptionPane.WARNING_MESSAGE);
}
else
{
JFrame frame2=new
JFrame("Result");
frame2.setSize(400,300);
JLabel name1=new JLabel("Name
: ");
JLabel age1=new JLabel("Age :
");
JLabel id1=new JLabel("ID :
");
name1.setBounds(100,30,100,30);
age1.setBounds(100,80,100,30);
id1.setBounds(100,130,100,30);
frame2.add(name1);
frame2.add(age1);
frame2.add(id1);
JTextField t11=new
JTextField();
JTextField t21=new
JTextField();
JTextField t31=new
JTextField();
t11.setText(a);
t21.setText(b);
t31.setText(c);
t11.setBounds(150,30,100,30);
t21.setBounds(150,80,100,30);
t31.setBounds(150,130,100,30);
frame2.add(t11);
frame2.add(t21);
frame2.add(t31);
JButton change=new
JButton("Change");
change.setBounds(140,180,100,30);
frame2.add(change);
change.addActionListener(new
ActionListener()
{
public
void actionPerformed(ActionEvent e)
{
String s1=t11.getText();
String s2=t21.getText();
String s3=t31.getText();
t1.setText(s1);
t2.setText(s2);
t3.setText(s3);
String result="Name : "+s1+"\n"+"Age :
"+s2+"\n"+"ID : "+s3;
text_area.setText("");
text_area.setText(result);
frame2.dispose();
}
});
frame2.setLayout(null);
frame2.setVisible(true);
}
}
});
close.addActionListener(new
ActionListener()
{
public void
actionPerformed(ActionEvent e)
{
frame.dispose();
}
});
frame.setLayout(null);
frame.setVisible(true);
}
}
Code Screenshots:-
Output:-
Please UPVOTE thank you...!!!
the program must contain the main method and example(s) must be included in the main method...
in JAVA please please include a main() and show output!!
Create a GUI program shown below. User enters information
through the first window. When “Close” button is clicked, your
program stops; when “Show Info” button is clicked, the input
information is displayed on the TextArea; while when “Modify”
button is clicked, the second window pops up and the information
user enters to the first window automatically fills in the second
window. User can change the information on the second window....
In JavaFX
Create a GUI program shown below. User enters information through the first window. When “Close” button is clicked, your program stops, when “Show Info” button is clicked, the input information is displayed on the TextArea; while when “Modify" button is clicked, the second window pops up and the information user enters to the first window automatically fills in the second window. User can change the information on the second window. After clicking the “Change” button on the second...
in java
the program must contain the main method and example( the number
50 should be the input) must be included in the main method to
check the correctness of your programs.
Create a GUI program to let user enter a positive integer n through the first window, and then your program prints out all the prime integers within the range [1, n) through the second window. Your program should contain two windows in total. Below are two example pictures:...
****THIS IS A 2 PART QUESTION! I ONLY NEED THE ANSWER TO PART 2
ON HOW TO SEND THE DATA SERIALIZED****
Write a c# program that stores student grades in a text file and
read grades from a text file. The program has the
following GUI:
There are four buttons: Create File, Save Case, Close File and
Load File. Initially, only the Create File and Load File
buttons are enabled. If the user clicks the Create File
button, a Save File Dialog window...
In Java, please write the program for the following program.
Please TEST YOUR PROGRAM. You MUST use GUI, that means all user
input must be through the windows. The "first window" is the window
on the top left of the following picture. Add 5 more items to be
purchased. Search is accessed from second window, top right. Thw
third window is the bottom left, and the fourth window is the
bottom right. The program MUST CONTAIN EVERYTHING IN THE PICTURES....
Write a complete JAVA program to do the following program.
The main program calls a method to read in (from an input file) a set of people's three-digit ID numbers and their donations to a charity (hint: use parallel arrays)Then the main program calls a method to sort the ID numbers into numerical order, being sure to carry along the corresponding donations. The main program then calls a method to print the sorted 1ists in tabular form, giving both ID...
Need help!!! I need two programs that use one common database.. One program using a Visual Basic windows form using textboxes for data input (first name, last name, phone, email) and it should save the info into an SQL database when a save button is clicked. Second program using a C# windows form that has a drop down menu with all the names that have been saved into the database, when one name is clicked all their information should pop...
Consider the attached Registration form.
Use jQuery to:
1) Change the "Search" link on the left to a button that when
clicked, hide all the fields on the form and display the text "This
is a search feature..."
2) Display "required" in every input field upon loading the
page
3) When the user fills the form and clicks "Login", the values
inputted should be displayed in the empty row (under Login) of the
page. The display should be in the...
Write a html javascript program to do the following: the user inputs a number, for example, 50 user presses a button, labeled START the program creates 50 random buttons around the browser window each button should be placed at a random location each button should be labeled with a random number between 1 and 50 add the following features every 2 seconds, move each button around by increment or decrementing its location if the user clicks on a button, change...