SlideShare a Scribd company logo
1 of 5
Download to read offline
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.pdfrishabjain5053
 
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.docxlez31palka
 
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 .pdffootworld1
 
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 UniversityNiraj 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.pdfforwardcom41
 
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.pdfADITIEYEWEAR
 
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.pdfShaiAlmog1
 
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.pdfmohammedfootwear
 
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
 
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
 
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
 
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.docxmckerliejonelle
 
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.pdfShaiAlmog1
 
College management system.pptx
College management system.pptxCollege management system.pptx
College management system.pptxManujArora3
 

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.pdfanjaniar7gallery
 
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.pdfanjaniar7gallery
 
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.pdfanjaniar7gallery
 
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.pdfanjaniar7gallery
 
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.pdfanjaniar7gallery
 
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.pdfanjaniar7gallery
 
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
 
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.pdfanjaniar7gallery
 
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.pdfanjaniar7gallery
 
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.pdfanjaniar7gallery
 
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.pdfanjaniar7gallery
 
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.pdfanjaniar7gallery
 
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.pdfanjaniar7gallery
 
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.pdfanjaniar7gallery
 
D is correctSolutionD is correct.pdf
D is correctSolutionD is correct.pdfD is correctSolutionD is correct.pdf
D is correctSolutionD is correct.pdfanjaniar7gallery
 
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.pdfanjaniar7gallery
 
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.pdfanjaniar7gallery
 
#! 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.pdfanjaniar7gallery
 
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.pdfanjaniar7gallery
 

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

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 

Recently uploaded (20)

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 

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]); } }); } }