SlideShare a Scribd company logo
1 of 8
i need a output screen shot for this code
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JSlider;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
public class Program {
public static void main(String[] args) {
JFrame frame = new JFrame("Data Entry");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(600, 400);
frame.setLocationRelativeTo(null);
// create the timer panel
JPanel timerPanel = new JPanel();
timerPanel.setBackground(Color.WHITE);
JLabel timerLabel = new JLabel("Timer: 00:00", SwingConstants.CENTER);
timerLabel.setFont(new Font("Courier", Font.PLAIN, 20));
Timer timer = new Timer(1000, e -> {
int time = Integer.parseInt(timerLabel.getText().substring(7)) + 1;
timerLabel.setText("Timer: " + String.format("%02d", time / 60) + ":" + String.format("%02d",
time % 60));
});
timer.start();
timerPanel.add(timerLabel);
// create the name panel
JPanel namePanel = new JPanel();
namePanel.setBackground(Color.WHITE);
JTextField nameField = new JTextField(20);
nameField.setFont(new Font("Courier", Font.PLAIN, 20));
nameField.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
nameField.setForeground(Color.BLUE);
}
@Override
public void focusLost(FocusEvent e) {}
});
JButton submitButton = new JButton("SUBMIT");
submitButton.setFont(new Font("Courier", Font.PLAIN, 20));
JTextArea textArea = new JTextArea(10, 40);
textArea.setFont(new Font("Courier", Font.PLAIN, 20));
textArea.setEditable(false);
textArea.setBorder(BorderFactory.createLineBorder(Color.BLACK));
submitButton.addActionListener(e -> {
String name = nameField.getText();
if (!name.equals("")) {
textArea.append(name + "n");
nameField.setText("");
}
});
namePanel.add(nameField);
namePanel.add(submitButton);
// create the font size panel
JPanel fontSizePanel = new JPanel();
fontSizePanel.setBackground(Color.WHITE);
JSlider fontSizeSlider = new JSlider(JSlider.HORIZONTAL, 10, 40, 20);
fontSizeSlider.setMajorTickSpacing(10);
fontSizeSlider.setMinorTickSpacing(5);
fontSizeSlider.setPaintTicks(true);
fontSizeSlider.setPaintLabels(true);
fontSizeSlider.setFont(new Font("Courier", Font.PLAIN, 20));
fontSizeSlider.addChangeListener(e -> {
int fontSize = fontSizeSlider.getValue();
Font font = new Font("Courier", Font.PLAIN, fontSize);
textArea.setFont(font);
});
fontSizePanel.add(fontSizeSlider);
// create the animation panel
JPanel animationPanel = new JPanel();
animationPanel.setBackground(Color.WHITE);
JLabel imageLabel = new JLabel();
ImageIcon horseIcon = new ImageIcon("horse.jpg");
ImageIcon birdIcon = new ImageIcon("bird.jpg");
ImageIcon aeroplanIcon = new ImageIcon("aeroplan.jpg");
imageLabel.setIcon(horseIcon);
JRadioButton horseButton = new JRadioButton("Horse", true);
horseButton.setFont(new Font("Courier", Font.PLAIN, 20));
JRadioButton birdButton = new JRadioButton("Bird"); birdButton.setFont(new Font("Courier",
Font.PLAIN, 20));
JRadioButton aeroplanButton = new JRadioButton("Aeroplan");
aeroplanButton.setFont(new Font("Courier", Font.PLAIN, 20));
horseButton.addActionListener(e -> imageLabel.setIcon(horseIcon));
birdButton.addActionListener(e -> imageLabel.setIcon(birdIcon));
aeroplanButton.addActionListener(e -> imageLabel.setIcon(aeroplanIcon));
animationPanel.add(horseButton);
animationPanel.add(birdButton);
animationPanel.add(aeroplanButton);
animationPanel.add(imageLabel);
// create the start and stop buttons
JPanel buttonPanel = new JPanel();
buttonPanel.setBackground(Color.WHITE);
JButton startButton = new JButton("Start");
startButton.setFont(new Font("Courier", Font.PLAIN, 20));
JButton stopButton = new JButton("Stop");
stopButton.setFont(new Font("Courier", Font.PLAIN, 20));
startButton.addActionListener(e -> {
Thread animationThread = new Thread(() -> {
while (true) {
ImageIcon currentIcon = (ImageIcon) imageLabel.getIcon();
if (currentIcon.equals(horseIcon)) {
imageLabel.setIcon(birdIcon);
} else if (currentIcon.equals(birdIcon)) {
imageLabel.setIcon(aeroplanIcon);
} else {
imageLabel.setIcon(horseIcon);
}
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
break;
}
}
});
animationThread.start();
});
stopButton.addActionListener(e -> {
for (Thread thread : Thread.getAllStackTraces().keySet()) {
if (thread.getName().startsWith("Thread-")) {
thread.interrupt();
}
}
});
buttonPanel.add(startButton);
buttonPanel.add(stopButton);
// create the main panel
JPanel mainPanel = new JPanel(new BorderLayout());
mainPanel.add(timerPanel, BorderLayout.NORTH);
mainPanel.add(namePanel, BorderLayout.CENTER);
mainPanel.add(fontSizePanel, BorderLayout.SOUTH);
// add the sub-panels to the main panel
mainPanel.add(animationPanel, BorderLayout.EAST);
mainPanel.add(buttonPanel, BorderLayout.SOUTH);
// add the main panel to the frame and show the frame
frame.add(mainPanel);
frame.setVisible(true);
// add a window listener to the frame to show a message when the program exits
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
timer.stop();
String time = timerLabel.getText().substring(7);
JOptionPane.showMessageDialog(frame, "Thank you for using my program for " + time + "
time.");
frame.setVisible(true);
}
});
}
}

More Related Content

Similar to i need a output screen shot for this code import java-awt-BorderLayou.docx

Unit-2 swing and mvc architecture
Unit-2 swing and mvc architectureUnit-2 swing and mvc architecture
Unit-2 swing and mvc architectureAmol Gaikwad
 
JAVA (JFrames)Dispay the color and RGB value of the background whe.pdf
JAVA (JFrames)Dispay the color and RGB value of the background whe.pdfJAVA (JFrames)Dispay the color and RGB value of the background whe.pdf
JAVA (JFrames)Dispay the color and RGB value of the background whe.pdfarihantmobileselepun
 
import java.awt.event.ActionEvent; import java.awt.event.ActionLis.pdf
import java.awt.event.ActionEvent; import java.awt.event.ActionLis.pdfimport java.awt.event.ActionEvent; import java.awt.event.ActionLis.pdf
import java.awt.event.ActionEvent; import java.awt.event.ActionLis.pdfanupambedcovers
 
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docxAliHaiderCheema2
 
import java.awt.BorderLayout; import java.awt.Color; import java.pdf
import java.awt.BorderLayout; import java.awt.Color; import java.pdfimport java.awt.BorderLayout; import java.awt.Color; import java.pdf
import java.awt.BorderLayout; import java.awt.Color; import java.pdfanwarfoot
 
PasswordCheckerGUI.javaimport javafx.application.Application; im.pdf
PasswordCheckerGUI.javaimport javafx.application.Application; im.pdfPasswordCheckerGUI.javaimport javafx.application.Application; im.pdf
PasswordCheckerGUI.javaimport javafx.application.Application; im.pdfanjaniar7gallery
 
Write a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdfWrite a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdffathimaoptical
 
write a prgoram that displays four images or objects in a 2 x 2 grid.pdf
write a prgoram that displays four images or objects in a 2 x 2 grid.pdfwrite a prgoram that displays four images or objects in a 2 x 2 grid.pdf
write a prgoram that displays four images or objects in a 2 x 2 grid.pdfPRATIKSINHA7304
 
Why am I getting an out of memory error and no window of my .pdf
Why am I getting an out of memory error and no window of my .pdfWhy am I getting an out of memory error and no window of my .pdf
Why am I getting an out of memory error and no window of my .pdfaakarcreations1
 
In Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdfIn Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdfflashfashioncasualwe
 
Write a program that moves the ball in a pane. You should define a p.pdf
Write a program that moves the ball in a pane. You should define a p.pdfWrite a program that moves the ball in a pane. You should define a p.pdf
Write a program that moves the ball in a pane. You should define a p.pdfsales98
 
This is Java,I am currently stumped on how to add a scoreboard for.pdf
This is Java,I am currently stumped on how to add a scoreboard for.pdfThis is Java,I am currently stumped on how to add a scoreboard for.pdf
This is Java,I am currently stumped on how to add a scoreboard for.pdfanjandavid
 
Revision c odesagain
Revision c odesagainRevision c odesagain
Revision c odesagainrex0721
 
mport javafx.application.Application;import javafx.scene.Node;im.pdf
mport javafx.application.Application;import javafx.scene.Node;im.pdfmport javafx.application.Application;import javafx.scene.Node;im.pdf
mport javafx.application.Application;import javafx.scene.Node;im.pdfanikkothari1
 
Create Splash Screen with Java Step by Step
Create Splash Screen with Java Step by StepCreate Splash Screen with Java Step by Step
Create Splash Screen with Java Step by StepOXUS 20
 
Othello.javapackage othello;import core.Game; import userInter.pdf
Othello.javapackage othello;import core.Game; import userInter.pdfOthello.javapackage othello;import core.Game; import userInter.pdf
Othello.javapackage othello;import core.Game; import userInter.pdfarccreation001
 

Similar to i need a output screen shot for this code import java-awt-BorderLayou.docx (20)

Scrollable Demo App
Scrollable Demo AppScrollable Demo App
Scrollable Demo App
 
Unit-2 swing and mvc architecture
Unit-2 swing and mvc architectureUnit-2 swing and mvc architecture
Unit-2 swing and mvc architecture
 
JAVA (JFrames)Dispay the color and RGB value of the background whe.pdf
JAVA (JFrames)Dispay the color and RGB value of the background whe.pdfJAVA (JFrames)Dispay the color and RGB value of the background whe.pdf
JAVA (JFrames)Dispay the color and RGB value of the background whe.pdf
 
DBTool
DBToolDBTool
DBTool
 
import java.awt.event.ActionEvent; import java.awt.event.ActionLis.pdf
import java.awt.event.ActionEvent; import java.awt.event.ActionLis.pdfimport java.awt.event.ActionEvent; import java.awt.event.ActionLis.pdf
import java.awt.event.ActionEvent; import java.awt.event.ActionLis.pdf
 
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
 
import java.awt.BorderLayout; import java.awt.Color; import java.pdf
import java.awt.BorderLayout; import java.awt.Color; import java.pdfimport java.awt.BorderLayout; import java.awt.Color; import java.pdf
import java.awt.BorderLayout; import java.awt.Color; import java.pdf
 
PasswordCheckerGUI.javaimport javafx.application.Application; im.pdf
PasswordCheckerGUI.javaimport javafx.application.Application; im.pdfPasswordCheckerGUI.javaimport javafx.application.Application; im.pdf
PasswordCheckerGUI.javaimport javafx.application.Application; im.pdf
 
Write a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdfWrite a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdf
 
write a prgoram that displays four images or objects in a 2 x 2 grid.pdf
write a prgoram that displays four images or objects in a 2 x 2 grid.pdfwrite a prgoram that displays four images or objects in a 2 x 2 grid.pdf
write a prgoram that displays four images or objects in a 2 x 2 grid.pdf
 
Why am I getting an out of memory error and no window of my .pdf
Why am I getting an out of memory error and no window of my .pdfWhy am I getting an out of memory error and no window of my .pdf
Why am I getting an out of memory error and no window of my .pdf
 
Tuto jtatoo
Tuto jtatooTuto jtatoo
Tuto jtatoo
 
In Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdfIn Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdf
 
Write a program that moves the ball in a pane. You should define a p.pdf
Write a program that moves the ball in a pane. You should define a p.pdfWrite a program that moves the ball in a pane. You should define a p.pdf
Write a program that moves the ball in a pane. You should define a p.pdf
 
This is Java,I am currently stumped on how to add a scoreboard for.pdf
This is Java,I am currently stumped on how to add a scoreboard for.pdfThis is Java,I am currently stumped on how to add a scoreboard for.pdf
This is Java,I am currently stumped on how to add a scoreboard for.pdf
 
Revision c odesagain
Revision c odesagainRevision c odesagain
Revision c odesagain
 
TextSearch
TextSearchTextSearch
TextSearch
 
mport javafx.application.Application;import javafx.scene.Node;im.pdf
mport javafx.application.Application;import javafx.scene.Node;im.pdfmport javafx.application.Application;import javafx.scene.Node;im.pdf
mport javafx.application.Application;import javafx.scene.Node;im.pdf
 
Create Splash Screen with Java Step by Step
Create Splash Screen with Java Step by StepCreate Splash Screen with Java Step by Step
Create Splash Screen with Java Step by Step
 
Othello.javapackage othello;import core.Game; import userInter.pdf
Othello.javapackage othello;import core.Game; import userInter.pdfOthello.javapackage othello;import core.Game; import userInter.pdf
Othello.javapackage othello;import core.Game; import userInter.pdf
 

More from PaulntmMilleri

III- EXERCISE 1- CALCULATING ALLELIC- GENOTYPIC- AND PHENOTYPIC FREQUE.docx
III- EXERCISE 1- CALCULATING ALLELIC- GENOTYPIC- AND PHENOTYPIC FREQUE.docxIII- EXERCISE 1- CALCULATING ALLELIC- GENOTYPIC- AND PHENOTYPIC FREQUE.docx
III- EXERCISE 1- CALCULATING ALLELIC- GENOTYPIC- AND PHENOTYPIC FREQUE.docxPaulntmMilleri
 
If your answer does not contain the proper ER Diagram- you will get a.docx
If your answer does not contain the proper ER Diagram- you will get a.docxIf your answer does not contain the proper ER Diagram- you will get a.docx
If your answer does not contain the proper ER Diagram- you will get a.docxPaulntmMilleri
 
If you want to create a layout for two buttons side by side on a windo.docx
If you want to create a layout for two buttons side by side on a windo.docxIf you want to create a layout for two buttons side by side on a windo.docx
If you want to create a layout for two buttons side by side on a windo.docxPaulntmMilleri
 
If P(B)-0-8- find P(BC)-.docx
If P(B)-0-8- find P(BC)-.docxIf P(B)-0-8- find P(BC)-.docx
If P(B)-0-8- find P(BC)-.docxPaulntmMilleri
 
If the GDP deflator is 400 and nominal GDP is $2 trillion billion- wha.docx
If the GDP deflator is 400 and nominal GDP is $2 trillion billion- wha.docxIf the GDP deflator is 400 and nominal GDP is $2 trillion billion- wha.docx
If the GDP deflator is 400 and nominal GDP is $2 trillion billion- wha.docxPaulntmMilleri
 
If event A-0-72 then the complement of event A-.docx
If event A-0-72 then the complement of event A-.docxIf event A-0-72 then the complement of event A-.docx
If event A-0-72 then the complement of event A-.docxPaulntmMilleri
 
If the Earth's orbit around the Sun was a perfect circle instead of an.docx
If the Earth's orbit around the Sun was a perfect circle instead of an.docxIf the Earth's orbit around the Sun was a perfect circle instead of an.docx
If the Earth's orbit around the Sun was a perfect circle instead of an.docxPaulntmMilleri
 
If I have 1-5 million dollars as a loan to start my own company and I.docx
If I have 1-5 million dollars as a loan to start my own company and I.docxIf I have 1-5 million dollars as a loan to start my own company and I.docx
If I have 1-5 million dollars as a loan to start my own company and I.docxPaulntmMilleri
 
If France and Korea engage in substantial trade but little financial f.docx
If France and Korea engage in substantial trade but little financial f.docxIf France and Korea engage in substantial trade but little financial f.docx
If France and Korea engage in substantial trade but little financial f.docxPaulntmMilleri
 
If a method overloads another method- can the two methods have differe.docx
If a method overloads another method- can the two methods have differe.docxIf a method overloads another method- can the two methods have differe.docx
If a method overloads another method- can the two methods have differe.docxPaulntmMilleri
 
If Assets equal $150 and Liabilities equal $30- what does Owner's Equi.docx
If Assets equal $150 and Liabilities equal $30- what does Owner's Equi.docxIf Assets equal $150 and Liabilities equal $30- what does Owner's Equi.docx
If Assets equal $150 and Liabilities equal $30- what does Owner's Equi.docxPaulntmMilleri
 
If a random variable X is uniformly distributed between 0 and 5 - what.docx
If a random variable X is uniformly distributed between 0 and 5 - what.docxIf a random variable X is uniformly distributed between 0 and 5 - what.docx
If a random variable X is uniformly distributed between 0 and 5 - what.docxPaulntmMilleri
 
If a corpus contains 10-000 documents- and a search query retrieves 10.docx
If a corpus contains 10-000 documents- and a search query retrieves 10.docxIf a corpus contains 10-000 documents- and a search query retrieves 10.docx
If a corpus contains 10-000 documents- and a search query retrieves 10.docxPaulntmMilleri
 
I- Explain this abstract and use some key points to use review some co.docx
I- Explain this abstract and use some key points to use review some co.docxI- Explain this abstract and use some key points to use review some co.docx
I- Explain this abstract and use some key points to use review some co.docxPaulntmMilleri
 
Identify the structure located at the point marked H- Do not give the.docx
Identify the structure located at the point marked H- Do not give the.docxIdentify the structure located at the point marked H- Do not give the.docx
Identify the structure located at the point marked H- Do not give the.docxPaulntmMilleri
 
Identify different aspects of organisational culture in some contempor.docx
Identify different aspects of organisational culture in some contempor.docxIdentify different aspects of organisational culture in some contempor.docx
Identify different aspects of organisational culture in some contempor.docxPaulntmMilleri
 
Identify and describe two ways that non-imaging providers- such as phy.docx
Identify and describe two ways that non-imaging providers- such as phy.docxIdentify and describe two ways that non-imaging providers- such as phy.docx
Identify and describe two ways that non-imaging providers- such as phy.docxPaulntmMilleri
 
Ibrahim is able to lend money to Naif (direct finance) with higher int.docx
Ibrahim is able to lend money to Naif (direct finance) with higher int.docxIbrahim is able to lend money to Naif (direct finance) with higher int.docx
Ibrahim is able to lend money to Naif (direct finance) with higher int.docxPaulntmMilleri
 
ib - ifpenata-1Journal Entries for Purchase- Return- and Remittance-Pe.docx
ib - ifpenata-1Journal Entries for Purchase- Return- and Remittance-Pe.docxib - ifpenata-1Journal Entries for Purchase- Return- and Remittance-Pe.docx
ib - ifpenata-1Journal Entries for Purchase- Return- and Remittance-Pe.docxPaulntmMilleri
 
I've also gathered a list of the primary selling features that Lavish.docx
I've also gathered a list of the primary selling features that Lavish.docxI've also gathered a list of the primary selling features that Lavish.docx
I've also gathered a list of the primary selling features that Lavish.docxPaulntmMilleri
 

More from PaulntmMilleri (20)

III- EXERCISE 1- CALCULATING ALLELIC- GENOTYPIC- AND PHENOTYPIC FREQUE.docx
III- EXERCISE 1- CALCULATING ALLELIC- GENOTYPIC- AND PHENOTYPIC FREQUE.docxIII- EXERCISE 1- CALCULATING ALLELIC- GENOTYPIC- AND PHENOTYPIC FREQUE.docx
III- EXERCISE 1- CALCULATING ALLELIC- GENOTYPIC- AND PHENOTYPIC FREQUE.docx
 
If your answer does not contain the proper ER Diagram- you will get a.docx
If your answer does not contain the proper ER Diagram- you will get a.docxIf your answer does not contain the proper ER Diagram- you will get a.docx
If your answer does not contain the proper ER Diagram- you will get a.docx
 
If you want to create a layout for two buttons side by side on a windo.docx
If you want to create a layout for two buttons side by side on a windo.docxIf you want to create a layout for two buttons side by side on a windo.docx
If you want to create a layout for two buttons side by side on a windo.docx
 
If P(B)-0-8- find P(BC)-.docx
If P(B)-0-8- find P(BC)-.docxIf P(B)-0-8- find P(BC)-.docx
If P(B)-0-8- find P(BC)-.docx
 
If the GDP deflator is 400 and nominal GDP is $2 trillion billion- wha.docx
If the GDP deflator is 400 and nominal GDP is $2 trillion billion- wha.docxIf the GDP deflator is 400 and nominal GDP is $2 trillion billion- wha.docx
If the GDP deflator is 400 and nominal GDP is $2 trillion billion- wha.docx
 
If event A-0-72 then the complement of event A-.docx
If event A-0-72 then the complement of event A-.docxIf event A-0-72 then the complement of event A-.docx
If event A-0-72 then the complement of event A-.docx
 
If the Earth's orbit around the Sun was a perfect circle instead of an.docx
If the Earth's orbit around the Sun was a perfect circle instead of an.docxIf the Earth's orbit around the Sun was a perfect circle instead of an.docx
If the Earth's orbit around the Sun was a perfect circle instead of an.docx
 
If I have 1-5 million dollars as a loan to start my own company and I.docx
If I have 1-5 million dollars as a loan to start my own company and I.docxIf I have 1-5 million dollars as a loan to start my own company and I.docx
If I have 1-5 million dollars as a loan to start my own company and I.docx
 
If France and Korea engage in substantial trade but little financial f.docx
If France and Korea engage in substantial trade but little financial f.docxIf France and Korea engage in substantial trade but little financial f.docx
If France and Korea engage in substantial trade but little financial f.docx
 
If a method overloads another method- can the two methods have differe.docx
If a method overloads another method- can the two methods have differe.docxIf a method overloads another method- can the two methods have differe.docx
If a method overloads another method- can the two methods have differe.docx
 
If Assets equal $150 and Liabilities equal $30- what does Owner's Equi.docx
If Assets equal $150 and Liabilities equal $30- what does Owner's Equi.docxIf Assets equal $150 and Liabilities equal $30- what does Owner's Equi.docx
If Assets equal $150 and Liabilities equal $30- what does Owner's Equi.docx
 
If a random variable X is uniformly distributed between 0 and 5 - what.docx
If a random variable X is uniformly distributed between 0 and 5 - what.docxIf a random variable X is uniformly distributed between 0 and 5 - what.docx
If a random variable X is uniformly distributed between 0 and 5 - what.docx
 
If a corpus contains 10-000 documents- and a search query retrieves 10.docx
If a corpus contains 10-000 documents- and a search query retrieves 10.docxIf a corpus contains 10-000 documents- and a search query retrieves 10.docx
If a corpus contains 10-000 documents- and a search query retrieves 10.docx
 
I- Explain this abstract and use some key points to use review some co.docx
I- Explain this abstract and use some key points to use review some co.docxI- Explain this abstract and use some key points to use review some co.docx
I- Explain this abstract and use some key points to use review some co.docx
 
Identify the structure located at the point marked H- Do not give the.docx
Identify the structure located at the point marked H- Do not give the.docxIdentify the structure located at the point marked H- Do not give the.docx
Identify the structure located at the point marked H- Do not give the.docx
 
Identify different aspects of organisational culture in some contempor.docx
Identify different aspects of organisational culture in some contempor.docxIdentify different aspects of organisational culture in some contempor.docx
Identify different aspects of organisational culture in some contempor.docx
 
Identify and describe two ways that non-imaging providers- such as phy.docx
Identify and describe two ways that non-imaging providers- such as phy.docxIdentify and describe two ways that non-imaging providers- such as phy.docx
Identify and describe two ways that non-imaging providers- such as phy.docx
 
Ibrahim is able to lend money to Naif (direct finance) with higher int.docx
Ibrahim is able to lend money to Naif (direct finance) with higher int.docxIbrahim is able to lend money to Naif (direct finance) with higher int.docx
Ibrahim is able to lend money to Naif (direct finance) with higher int.docx
 
ib - ifpenata-1Journal Entries for Purchase- Return- and Remittance-Pe.docx
ib - ifpenata-1Journal Entries for Purchase- Return- and Remittance-Pe.docxib - ifpenata-1Journal Entries for Purchase- Return- and Remittance-Pe.docx
ib - ifpenata-1Journal Entries for Purchase- Return- and Remittance-Pe.docx
 
I've also gathered a list of the primary selling features that Lavish.docx
I've also gathered a list of the primary selling features that Lavish.docxI've also gathered a list of the primary selling features that Lavish.docx
I've also gathered a list of the primary selling features that Lavish.docx
 

Recently uploaded

Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 

Recently uploaded (20)

LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 

i need a output screen shot for this code import java-awt-BorderLayou.docx

  • 1. i need a output screen shot for this code import java.awt.BorderLayout; import java.awt.Color; import java.awt.Font; import java.awt.event.FocusEvent; import java.awt.event.FocusListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.JSlider; import javax.swing.JTextArea; import javax.swing.JTextField; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.Timer; import javax.swing.event.ChangeEvent;
  • 2. import javax.swing.event.ChangeListener; public class Program { public static void main(String[] args) { JFrame frame = new JFrame("Data Entry"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(600, 400); frame.setLocationRelativeTo(null); // create the timer panel JPanel timerPanel = new JPanel(); timerPanel.setBackground(Color.WHITE); JLabel timerLabel = new JLabel("Timer: 00:00", SwingConstants.CENTER); timerLabel.setFont(new Font("Courier", Font.PLAIN, 20)); Timer timer = new Timer(1000, e -> { int time = Integer.parseInt(timerLabel.getText().substring(7)) + 1; timerLabel.setText("Timer: " + String.format("%02d", time / 60) + ":" + String.format("%02d", time % 60)); }); timer.start(); timerPanel.add(timerLabel); // create the name panel JPanel namePanel = new JPanel(); namePanel.setBackground(Color.WHITE); JTextField nameField = new JTextField(20); nameField.setFont(new Font("Courier", Font.PLAIN, 20));
  • 3. nameField.addFocusListener(new FocusListener() { @Override public void focusGained(FocusEvent e) { nameField.setForeground(Color.BLUE); } @Override public void focusLost(FocusEvent e) {} }); JButton submitButton = new JButton("SUBMIT"); submitButton.setFont(new Font("Courier", Font.PLAIN, 20)); JTextArea textArea = new JTextArea(10, 40); textArea.setFont(new Font("Courier", Font.PLAIN, 20)); textArea.setEditable(false); textArea.setBorder(BorderFactory.createLineBorder(Color.BLACK)); submitButton.addActionListener(e -> { String name = nameField.getText(); if (!name.equals("")) { textArea.append(name + "n"); nameField.setText(""); } }); namePanel.add(nameField); namePanel.add(submitButton);
  • 4. // create the font size panel JPanel fontSizePanel = new JPanel(); fontSizePanel.setBackground(Color.WHITE); JSlider fontSizeSlider = new JSlider(JSlider.HORIZONTAL, 10, 40, 20); fontSizeSlider.setMajorTickSpacing(10); fontSizeSlider.setMinorTickSpacing(5); fontSizeSlider.setPaintTicks(true); fontSizeSlider.setPaintLabels(true); fontSizeSlider.setFont(new Font("Courier", Font.PLAIN, 20)); fontSizeSlider.addChangeListener(e -> { int fontSize = fontSizeSlider.getValue(); Font font = new Font("Courier", Font.PLAIN, fontSize); textArea.setFont(font); }); fontSizePanel.add(fontSizeSlider); // create the animation panel JPanel animationPanel = new JPanel(); animationPanel.setBackground(Color.WHITE); JLabel imageLabel = new JLabel(); ImageIcon horseIcon = new ImageIcon("horse.jpg"); ImageIcon birdIcon = new ImageIcon("bird.jpg"); ImageIcon aeroplanIcon = new ImageIcon("aeroplan.jpg"); imageLabel.setIcon(horseIcon);
  • 5. JRadioButton horseButton = new JRadioButton("Horse", true); horseButton.setFont(new Font("Courier", Font.PLAIN, 20)); JRadioButton birdButton = new JRadioButton("Bird"); birdButton.setFont(new Font("Courier", Font.PLAIN, 20)); JRadioButton aeroplanButton = new JRadioButton("Aeroplan"); aeroplanButton.setFont(new Font("Courier", Font.PLAIN, 20)); horseButton.addActionListener(e -> imageLabel.setIcon(horseIcon)); birdButton.addActionListener(e -> imageLabel.setIcon(birdIcon)); aeroplanButton.addActionListener(e -> imageLabel.setIcon(aeroplanIcon)); animationPanel.add(horseButton); animationPanel.add(birdButton); animationPanel.add(aeroplanButton); animationPanel.add(imageLabel); // create the start and stop buttons JPanel buttonPanel = new JPanel(); buttonPanel.setBackground(Color.WHITE); JButton startButton = new JButton("Start"); startButton.setFont(new Font("Courier", Font.PLAIN, 20)); JButton stopButton = new JButton("Stop"); stopButton.setFont(new Font("Courier", Font.PLAIN, 20)); startButton.addActionListener(e -> { Thread animationThread = new Thread(() -> { while (true) { ImageIcon currentIcon = (ImageIcon) imageLabel.getIcon();
  • 6. if (currentIcon.equals(horseIcon)) { imageLabel.setIcon(birdIcon); } else if (currentIcon.equals(birdIcon)) { imageLabel.setIcon(aeroplanIcon); } else { imageLabel.setIcon(horseIcon); } try { Thread.sleep(500); } catch (InterruptedException ex) { break; } } }); animationThread.start(); }); stopButton.addActionListener(e -> { for (Thread thread : Thread.getAllStackTraces().keySet()) { if (thread.getName().startsWith("Thread-")) { thread.interrupt(); } } });
  • 7. buttonPanel.add(startButton); buttonPanel.add(stopButton); // create the main panel JPanel mainPanel = new JPanel(new BorderLayout()); mainPanel.add(timerPanel, BorderLayout.NORTH); mainPanel.add(namePanel, BorderLayout.CENTER); mainPanel.add(fontSizePanel, BorderLayout.SOUTH); // add the sub-panels to the main panel mainPanel.add(animationPanel, BorderLayout.EAST); mainPanel.add(buttonPanel, BorderLayout.SOUTH); // add the main panel to the frame and show the frame frame.add(mainPanel); frame.setVisible(true); // add a window listener to the frame to show a message when the program exits frame.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { timer.stop(); String time = timerLabel.getText().substring(7); JOptionPane.showMessageDialog(frame, "Thank you for using my program for " + time + " time."); frame.setVisible(true); } });
  • 8. } }