SlideShare a Scribd company logo
Please let me know if you need more clarification.
final String path = "/opt/"; path should be proper
import java.awt.EventQueue;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.Timer;
public class Example extends JPanel implements ActionListener {
private static final int N = 4;
private final List list = new ArrayList();
private final Timer timer = new Timer(1000, this);
Example(String image1,String image2,String image3) {
this.setLayout(new GridLayout(N, N));
BufferedImage bi = null;
BufferedImage bi1 = null;
BufferedImage bi2 = null;
try {
bi = ImageIO.read(new File(image1));
bi1 = ImageIO.read(new File(image2));
bi2 = ImageIO.read(new File(image3));
} catch (IOException e) {
e.printStackTrace();
}
list.add(new JLabel(new ImageIcon(bi)));
list.add(new JLabel(new ImageIcon(bi1)));
list.add(new JLabel(new ImageIcon(bi2)));
createPane();
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.add(this);
f.pack();
f.setVisible(true);
timer.start();
}
private void createPane() {
this.removeAll();
for (JLabel label : list) add(label);
this.validate();
}
@Override
public void actionPerformed(ActionEvent e) {
Collections.shuffle(list);
createPane();
}
public static void main(String[] args) {
final String path = "/opt/";
final ArrayList list = new ArrayList();
for (int i=1; i<52; i++) {
list.add(new Integer(i));
}
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
Collections.shuffle(list);
String image1[]={"","",""};
for (int i=0; i<3; i++) {
image1[i] = path + list.get(i) +".jpg";
System.out.println(image1[i]);
}
new Example(image1[0],image1[1],image1[2]);
}
});
}
}
Solution
Please let me know if you need more clarification.
final String path = "/opt/"; path should be proper
import java.awt.EventQueue;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.Timer;
public class Example extends JPanel implements ActionListener {
private static final int N = 4;
private final List list = new ArrayList();
private final Timer timer = new Timer(1000, this);
Example(String image1,String image2,String image3) {
this.setLayout(new GridLayout(N, N));
BufferedImage bi = null;
BufferedImage bi1 = null;
BufferedImage bi2 = null;
try {
bi = ImageIO.read(new File(image1));
bi1 = ImageIO.read(new File(image2));
bi2 = ImageIO.read(new File(image3));
} catch (IOException e) {
e.printStackTrace();
}
list.add(new JLabel(new ImageIcon(bi)));
list.add(new JLabel(new ImageIcon(bi1)));
list.add(new JLabel(new ImageIcon(bi2)));
createPane();
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.add(this);
f.pack();
f.setVisible(true);
timer.start();
}
private void createPane() {
this.removeAll();
for (JLabel label : list) add(label);
this.validate();
}
@Override
public void actionPerformed(ActionEvent e) {
Collections.shuffle(list);
createPane();
}
public static void main(String[] args) {
final String path = "/opt/";
final ArrayList list = new ArrayList();
for (int i=1; i<52; i++) {
list.add(new Integer(i));
}
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
Collections.shuffle(list);
String image1[]={"","",""};
for (int i=0; i<3; i++) {
image1[i] = path + list.get(i) +".jpg";
System.out.println(image1[i]);
}
new Example(image1[0],image1[1],image1[2]);
}
});
}
}

More Related Content

Similar to Please let me know if you need more clarification.final String pat.pdf

Description (Part A) In this lab you will write a Queue implementati.pdf
Description (Part A) In this lab you will write a Queue implementati.pdfDescription (Part A) In this lab you will write a Queue implementati.pdf
Description (Part A) In this lab you will write a Queue implementati.pdf
rishabjain5053
 
Write a new view class that displays the tree horizontally with the ro.docx
Write a new view class that displays the tree horizontally with the ro.docxWrite a new view class that displays the tree horizontally with the ro.docx
Write a new view class that displays the tree horizontally with the ro.docx
lez31palka
 
Use arrays to store data for analysis. Use functions to perform the .pdf
Use arrays to store data for analysis. Use functions to perform the .pdfUse arrays to store data for analysis. Use functions to perform the .pdf
Use arrays to store data for analysis. Use functions to perform the .pdf
footworld1
 
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai UniversityT.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
Niraj Bharambe
 
How do I make my JTable non editableimport java.awt.; import j.pdf
How do I make my JTable non editableimport java.awt.; import j.pdfHow do I make my JTable non editableimport java.awt.; import j.pdf
How do I make my JTable non editableimport java.awt.; import j.pdf
forwardcom41
 
Jason parsing
Jason parsingJason parsing
Jason parsing
parallelminder
 
import javaxswing import javaawtevent import javai.pdf
import javaxswing import javaawtevent import javai.pdfimport javaxswing import javaawtevent import javai.pdf
import javaxswing import javaawtevent import javai.pdf
ADITIEYEWEAR
 
Hacking the Codename One Source Code - Part III.pdf
Hacking the Codename One Source Code - Part III.pdfHacking the Codename One Source Code - Part III.pdf
Hacking the Codename One Source Code - Part III.pdf
ShaiAlmog1
 
Important java programs(collection+file)
Important java programs(collection+file)Important java programs(collection+file)
Important java programs(collection+file)Alok Kumar
 
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdfPLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
mohammedfootwear
 
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
flashfashioncasualwe
 
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
arccreation001
 
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
fathimaoptical
 
in java(netbeans) create a javaFX GUI that can open and display the co.docx
in java(netbeans) create a javaFX GUI that can open and display the co.docxin java(netbeans) create a javaFX GUI that can open and display the co.docx
in java(netbeans) create a javaFX GUI that can open and display the co.docx
mckerliejonelle
 
Hacking the Codename One Source Code - Part III - Transcript.pdf
Hacking the Codename One Source Code - Part III - Transcript.pdfHacking the Codename One Source Code - Part III - Transcript.pdf
Hacking the Codename One Source Code - Part III - Transcript.pdf
ShaiAlmog1
 
College management system.pptx
College management system.pptxCollege management system.pptx
College management system.pptx
ManujArora3
 
Java awt
Java awtJava awt
From Swing to JavaFX
From Swing to JavaFXFrom Swing to JavaFX
From Swing to JavaFX
Yuichi Sakuraba
 

Similar to Please let me know if you need more clarification.final String pat.pdf (20)

Description (Part A) In this lab you will write a Queue implementati.pdf
Description (Part A) In this lab you will write a Queue implementati.pdfDescription (Part A) In this lab you will write a Queue implementati.pdf
Description (Part A) In this lab you will write a Queue implementati.pdf
 
TextSearch
TextSearchTextSearch
TextSearch
 
Write a new view class that displays the tree horizontally with the ro.docx
Write a new view class that displays the tree horizontally with the ro.docxWrite a new view class that displays the tree horizontally with the ro.docx
Write a new view class that displays the tree horizontally with the ro.docx
 
Use arrays to store data for analysis. Use functions to perform the .pdf
Use arrays to store data for analysis. Use functions to perform the .pdfUse arrays to store data for analysis. Use functions to perform the .pdf
Use arrays to store data for analysis. Use functions to perform the .pdf
 
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai UniversityT.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
 
How do I make my JTable non editableimport java.awt.; import j.pdf
How do I make my JTable non editableimport java.awt.; import j.pdfHow do I make my JTable non editableimport java.awt.; import j.pdf
How do I make my JTable non editableimport java.awt.; import j.pdf
 
Jason parsing
Jason parsingJason parsing
Jason parsing
 
DBTool
DBToolDBTool
DBTool
 
import javaxswing import javaawtevent import javai.pdf
import javaxswing import javaawtevent import javai.pdfimport javaxswing import javaawtevent import javai.pdf
import javaxswing import javaawtevent import javai.pdf
 
Hacking the Codename One Source Code - Part III.pdf
Hacking the Codename One Source Code - Part III.pdfHacking the Codename One Source Code - Part III.pdf
Hacking the Codename One Source Code - Part III.pdf
 
Important java programs(collection+file)
Important java programs(collection+file)Important java programs(collection+file)
Important java programs(collection+file)
 
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdfPLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
 
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
 
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
 
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
 
in java(netbeans) create a javaFX GUI that can open and display the co.docx
in java(netbeans) create a javaFX GUI that can open and display the co.docxin java(netbeans) create a javaFX GUI that can open and display the co.docx
in java(netbeans) create a javaFX GUI that can open and display the co.docx
 
Hacking the Codename One Source Code - Part III - Transcript.pdf
Hacking the Codename One Source Code - Part III - Transcript.pdfHacking the Codename One Source Code - Part III - Transcript.pdf
Hacking the Codename One Source Code - Part III - Transcript.pdf
 
College management system.pptx
College management system.pptxCollege management system.pptx
College management system.pptx
 
Java awt
Java awtJava awt
Java awt
 
From Swing to JavaFX
From Swing to JavaFXFrom Swing to JavaFX
From Swing to JavaFX
 

More from anjaniar7gallery

Will be uploaded soonSolutionWill be uploaded soon.pdf
Will be uploaded soonSolutionWill be uploaded soon.pdfWill be uploaded soonSolutionWill be uploaded soon.pdf
Will be uploaded soonSolutionWill be uploaded soon.pdf
anjaniar7gallery
 
yeah...it is... you are 100 rightSolutionyeah...it is... you.pdf
yeah...it is... you are 100  rightSolutionyeah...it is... you.pdfyeah...it is... you are 100  rightSolutionyeah...it is... you.pdf
yeah...it is... you are 100 rightSolutionyeah...it is... you.pdf
anjaniar7gallery
 
trying to upload imageSolutiontrying to upload image.pdf
trying to upload imageSolutiontrying to upload image.pdftrying to upload imageSolutiontrying to upload image.pdf
trying to upload imageSolutiontrying to upload image.pdf
anjaniar7gallery
 
This is social movement of British textile artisans in the early nin.pdf
This is social movement of British textile artisans in the early nin.pdfThis is social movement of British textile artisans in the early nin.pdf
This is social movement of British textile artisans in the early nin.pdf
anjaniar7gallery
 
TCP RFC 793 TCPIP (Transmission Control ProtocolInternet Proto.pdf
TCP  RFC 793 TCPIP (Transmission Control ProtocolInternet Proto.pdfTCP  RFC 793 TCPIP (Transmission Control ProtocolInternet Proto.pdf
TCP RFC 793 TCPIP (Transmission Control ProtocolInternet Proto.pdf
anjaniar7gallery
 
sec-BuLi can be prepared by the reaction of sec-butyl halideswith li.pdf
sec-BuLi can be prepared by the reaction of sec-butyl halideswith li.pdfsec-BuLi can be prepared by the reaction of sec-butyl halideswith li.pdf
sec-BuLi can be prepared by the reaction of sec-butyl halideswith li.pdf
anjaniar7gallery
 
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
anjaniar7gallery
 
pH + pOH = 14 pOH = 4.5 [OH-] = 10-4.5Fe(OH)2 --- Fe2+ + 2 O.pdf
pH + pOH = 14 pOH = 4.5 [OH-] = 10-4.5Fe(OH)2 --- Fe2+ + 2 O.pdfpH + pOH = 14 pOH = 4.5 [OH-] = 10-4.5Fe(OH)2 --- Fe2+ + 2 O.pdf
pH + pOH = 14 pOH = 4.5 [OH-] = 10-4.5Fe(OH)2 --- Fe2+ + 2 O.pdf
anjaniar7gallery
 
Node for list storage. class Ndd { int data; Ndd next; N.pdf
Node for list storage. class Ndd { int data; Ndd next; N.pdfNode for list storage. class Ndd { int data; Ndd next; N.pdf
Node for list storage. class Ndd { int data; Ndd next; N.pdf
anjaniar7gallery
 
Laser ScanningLaser scanning is an emerging data acquisition techn.pdf
Laser ScanningLaser scanning is an emerging data acquisition techn.pdfLaser ScanningLaser scanning is an emerging data acquisition techn.pdf
Laser ScanningLaser scanning is an emerging data acquisition techn.pdf
anjaniar7gallery
 
InternetService.java import java.text.DecimalFormat; import jav.pdf
InternetService.java  import java.text.DecimalFormat; import jav.pdfInternetService.java  import java.text.DecimalFormat; import jav.pdf
InternetService.java import java.text.DecimalFormat; import jav.pdf
anjaniar7gallery
 
Importance of planning to the practice of managementSolutionIm.pdf
Importance of planning to the practice of managementSolutionIm.pdfImportance of planning to the practice of managementSolutionIm.pdf
Importance of planning to the practice of managementSolutionIm.pdf
anjaniar7gallery
 
Hardware refers to all of the physical parts of a computer system. F.pdf
Hardware refers to all of the physical parts of a computer system. F.pdfHardware refers to all of the physical parts of a computer system. F.pdf
Hardware refers to all of the physical parts of a computer system. F.pdf
anjaniar7gallery
 
Events after the reporting period are those events favorable and unf.pdf
Events after the reporting period are those events favorable and unf.pdfEvents after the reporting period are those events favorable and unf.pdf
Events after the reporting period are those events favorable and unf.pdf
anjaniar7gallery
 
D is correctSolutionD is correct.pdf
D is correctSolutionD is correct.pdfD is correctSolutionD is correct.pdf
D is correctSolutionD is correct.pdf
anjaniar7gallery
 
Cost centersCost centers are Centers that incur costs for operati.pdf
Cost centersCost centers are Centers that incur costs for operati.pdfCost centersCost centers are Centers that incur costs for operati.pdf
Cost centersCost centers are Centers that incur costs for operati.pdf
anjaniar7gallery
 
Calcium Phosphate is a slightly soluble salt. Here isthe equation fo.pdf
Calcium Phosphate is a slightly soluble salt. Here isthe equation fo.pdfCalcium Phosphate is a slightly soluble salt. Here isthe equation fo.pdf
Calcium Phosphate is a slightly soluble salt. Here isthe equation fo.pdf
anjaniar7gallery
 
c.250Solutionc.250.pdf
c.250Solutionc.250.pdfc.250Solutionc.250.pdf
c.250Solutionc.250.pdf
anjaniar7gallery
 
#! usrbinpython def Flatten(list) newList = [] for i in ra.pdf
#! usrbinpython def Flatten(list) newList = [] for i in ra.pdf#! usrbinpython def Flatten(list) newList = [] for i in ra.pdf
#! usrbinpython def Flatten(list) newList = [] for i in ra.pdf
anjaniar7gallery
 
a) Two domains are OD1 and OD2 domains. The common function of OD1 a.pdf
a) Two domains are OD1 and OD2 domains. The common function of OD1 a.pdfa) Two domains are OD1 and OD2 domains. The common function of OD1 a.pdf
a) Two domains are OD1 and OD2 domains. The common function of OD1 a.pdf
anjaniar7gallery
 

More from anjaniar7gallery (20)

Will be uploaded soonSolutionWill be uploaded soon.pdf
Will be uploaded soonSolutionWill be uploaded soon.pdfWill be uploaded soonSolutionWill be uploaded soon.pdf
Will be uploaded soonSolutionWill be uploaded soon.pdf
 
yeah...it is... you are 100 rightSolutionyeah...it is... you.pdf
yeah...it is... you are 100  rightSolutionyeah...it is... you.pdfyeah...it is... you are 100  rightSolutionyeah...it is... you.pdf
yeah...it is... you are 100 rightSolutionyeah...it is... you.pdf
 
trying to upload imageSolutiontrying to upload image.pdf
trying to upload imageSolutiontrying to upload image.pdftrying to upload imageSolutiontrying to upload image.pdf
trying to upload imageSolutiontrying to upload image.pdf
 
This is social movement of British textile artisans in the early nin.pdf
This is social movement of British textile artisans in the early nin.pdfThis is social movement of British textile artisans in the early nin.pdf
This is social movement of British textile artisans in the early nin.pdf
 
TCP RFC 793 TCPIP (Transmission Control ProtocolInternet Proto.pdf
TCP  RFC 793 TCPIP (Transmission Control ProtocolInternet Proto.pdfTCP  RFC 793 TCPIP (Transmission Control ProtocolInternet Proto.pdf
TCP RFC 793 TCPIP (Transmission Control ProtocolInternet Proto.pdf
 
sec-BuLi can be prepared by the reaction of sec-butyl halideswith li.pdf
sec-BuLi can be prepared by the reaction of sec-butyl halideswith li.pdfsec-BuLi can be prepared by the reaction of sec-butyl halideswith li.pdf
sec-BuLi can be prepared by the reaction of sec-butyl halideswith li.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
 
pH + pOH = 14 pOH = 4.5 [OH-] = 10-4.5Fe(OH)2 --- Fe2+ + 2 O.pdf
pH + pOH = 14 pOH = 4.5 [OH-] = 10-4.5Fe(OH)2 --- Fe2+ + 2 O.pdfpH + pOH = 14 pOH = 4.5 [OH-] = 10-4.5Fe(OH)2 --- Fe2+ + 2 O.pdf
pH + pOH = 14 pOH = 4.5 [OH-] = 10-4.5Fe(OH)2 --- Fe2+ + 2 O.pdf
 
Node for list storage. class Ndd { int data; Ndd next; N.pdf
Node for list storage. class Ndd { int data; Ndd next; N.pdfNode for list storage. class Ndd { int data; Ndd next; N.pdf
Node for list storage. class Ndd { int data; Ndd next; N.pdf
 
Laser ScanningLaser scanning is an emerging data acquisition techn.pdf
Laser ScanningLaser scanning is an emerging data acquisition techn.pdfLaser ScanningLaser scanning is an emerging data acquisition techn.pdf
Laser ScanningLaser scanning is an emerging data acquisition techn.pdf
 
InternetService.java import java.text.DecimalFormat; import jav.pdf
InternetService.java  import java.text.DecimalFormat; import jav.pdfInternetService.java  import java.text.DecimalFormat; import jav.pdf
InternetService.java import java.text.DecimalFormat; import jav.pdf
 
Importance of planning to the practice of managementSolutionIm.pdf
Importance of planning to the practice of managementSolutionIm.pdfImportance of planning to the practice of managementSolutionIm.pdf
Importance of planning to the practice of managementSolutionIm.pdf
 
Hardware refers to all of the physical parts of a computer system. F.pdf
Hardware refers to all of the physical parts of a computer system. F.pdfHardware refers to all of the physical parts of a computer system. F.pdf
Hardware refers to all of the physical parts of a computer system. F.pdf
 
Events after the reporting period are those events favorable and unf.pdf
Events after the reporting period are those events favorable and unf.pdfEvents after the reporting period are those events favorable and unf.pdf
Events after the reporting period are those events favorable and unf.pdf
 
D is correctSolutionD is correct.pdf
D is correctSolutionD is correct.pdfD is correctSolutionD is correct.pdf
D is correctSolutionD is correct.pdf
 
Cost centersCost centers are Centers that incur costs for operati.pdf
Cost centersCost centers are Centers that incur costs for operati.pdfCost centersCost centers are Centers that incur costs for operati.pdf
Cost centersCost centers are Centers that incur costs for operati.pdf
 
Calcium Phosphate is a slightly soluble salt. Here isthe equation fo.pdf
Calcium Phosphate is a slightly soluble salt. Here isthe equation fo.pdfCalcium Phosphate is a slightly soluble salt. Here isthe equation fo.pdf
Calcium Phosphate is a slightly soluble salt. Here isthe equation fo.pdf
 
c.250Solutionc.250.pdf
c.250Solutionc.250.pdfc.250Solutionc.250.pdf
c.250Solutionc.250.pdf
 
#! usrbinpython def Flatten(list) newList = [] for i in ra.pdf
#! usrbinpython def Flatten(list) newList = [] for i in ra.pdf#! usrbinpython def Flatten(list) newList = [] for i in ra.pdf
#! usrbinpython def Flatten(list) newList = [] for i in ra.pdf
 
a) Two domains are OD1 and OD2 domains. The common function of OD1 a.pdf
a) Two domains are OD1 and OD2 domains. The common function of OD1 a.pdfa) Two domains are OD1 and OD2 domains. The common function of OD1 a.pdf
a) Two domains are OD1 and OD2 domains. The common function of OD1 a.pdf
 

Recently uploaded

Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 

Recently uploaded (20)

Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 

Please let me know if you need more clarification.final String pat.pdf

  • 1. Please let me know if you need more clarification. final String path = "/opt/"; path should be proper import java.awt.EventQueue; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import javax.imageio.ImageIO; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.Timer; public class Example extends JPanel implements ActionListener { private static final int N = 4; private final List list = new ArrayList(); private final Timer timer = new Timer(1000, this); Example(String image1,String image2,String image3) { this.setLayout(new GridLayout(N, N)); BufferedImage bi = null; BufferedImage bi1 = null; BufferedImage bi2 = null; try { bi = ImageIO.read(new File(image1)); bi1 = ImageIO.read(new File(image2)); bi2 = ImageIO.read(new File(image3)); } catch (IOException e) { e.printStackTrace(); }
  • 2. list.add(new JLabel(new ImageIcon(bi))); list.add(new JLabel(new ImageIcon(bi1))); list.add(new JLabel(new ImageIcon(bi2))); createPane(); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(this); f.pack(); f.setVisible(true); timer.start(); } private void createPane() { this.removeAll(); for (JLabel label : list) add(label); this.validate(); } @Override public void actionPerformed(ActionEvent e) { Collections.shuffle(list); createPane(); } public static void main(String[] args) { final String path = "/opt/"; final ArrayList list = new ArrayList(); for (int i=1; i<52; i++) { list.add(new Integer(i)); } EventQueue.invokeLater(new Runnable() { @Override public void run() { Collections.shuffle(list); String image1[]={"","",""}; for (int i=0; i<3; i++) { image1[i] = path + list.get(i) +".jpg"; System.out.println(image1[i]); }
  • 3. new Example(image1[0],image1[1],image1[2]); } }); } } Solution Please let me know if you need more clarification. final String path = "/opt/"; path should be proper import java.awt.EventQueue; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import javax.imageio.ImageIO; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.Timer; public class Example extends JPanel implements ActionListener { private static final int N = 4; private final List list = new ArrayList(); private final Timer timer = new Timer(1000, this); Example(String image1,String image2,String image3) { this.setLayout(new GridLayout(N, N)); BufferedImage bi = null; BufferedImage bi1 = null; BufferedImage bi2 = null; try {
  • 4. bi = ImageIO.read(new File(image1)); bi1 = ImageIO.read(new File(image2)); bi2 = ImageIO.read(new File(image3)); } catch (IOException e) { e.printStackTrace(); } list.add(new JLabel(new ImageIcon(bi))); list.add(new JLabel(new ImageIcon(bi1))); list.add(new JLabel(new ImageIcon(bi2))); createPane(); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(this); f.pack(); f.setVisible(true); timer.start(); } private void createPane() { this.removeAll(); for (JLabel label : list) add(label); this.validate(); } @Override public void actionPerformed(ActionEvent e) { Collections.shuffle(list); createPane(); } public static void main(String[] args) { final String path = "/opt/"; final ArrayList list = new ArrayList(); for (int i=1; i<52; i++) { list.add(new Integer(i)); } EventQueue.invokeLater(new Runnable() { @Override
  • 5. public void run() { Collections.shuffle(list); String image1[]={"","",""}; for (int i=0; i<3; i++) { image1[i] = path + list.get(i) +".jpg"; System.out.println(image1[i]); } new Example(image1[0],image1[1],image1[2]); } }); } }