SlideShare a Scribd company logo
DateGUI.java
import java.awt.*;
import javax.swing.*;
public class DateGUI extends JFrame{
DateGUI()
{
//getting the arraylist
Project1 proj = new Project1();
proj.readFile("C:filename");
proj.checkDates();
ArrayList dates = proj.selectionSort();
ArrayList beforeSortArray = proj.getArrayBeforeSorting();
//GUI code
JFrame frame = new JFrame("Exam");
frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
frame.setSize(500,600);
// don't mix Swing with AWT
JPanel contain = new JPanel();
System.out.println(contain.getLayout());
frame.setContentPane(contain);
contain.setLayout(new GridLayout(1,2));
JTextArea txtarea = new JTextArea();
contain.add(txtarea);
for(int i=0; i dates = new ArrayList();
public ArrayList Finaldates = new ArrayList();
public void readFile(String filename)
{
BufferedReader br = null;
try {
String sCurrentLine;
br = new BufferedReader(new FileReader(filename));
while ((sCurrentLine = br.readLine()) != null) {
if(sCurrentLine.length() == 8)
{
dates.add(sCurrentLine);
}
else
{
if(sCurrentLine.contains(","))
{
String delim = ",";
StringTokenizer tokenizer = new StringTokenizer(sCurrentLine,delim);
while(tokenizer.hasMoreElements())
{
String nextElem = tokenizer.nextElement();
if(nextElem.length() == 8)
{
dates.add(nextElem);
}
else
{
System.out.println("Invalid String: "+nextElem);
}
}
}
else
{
System.out.println("Invalid String: "+sCurrentLine);
}
}
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (br != null)br.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
public void checkDates()
{
for(int i=0;i getArrayBeforeSorting()
{
return dates;
}
public ArrayList selectionSort()
{
for(int i=0; i
Solution
DateGUI.java
import java.awt.*;
import javax.swing.*;
public class DateGUI extends JFrame{
DateGUI()
{
//getting the arraylist
Project1 proj = new Project1();
proj.readFile("C:filename");
proj.checkDates();
ArrayList dates = proj.selectionSort();
ArrayList beforeSortArray = proj.getArrayBeforeSorting();
//GUI code
JFrame frame = new JFrame("Exam");
frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
frame.setSize(500,600);
// don't mix Swing with AWT
JPanel contain = new JPanel();
System.out.println(contain.getLayout());
frame.setContentPane(contain);
contain.setLayout(new GridLayout(1,2));
JTextArea txtarea = new JTextArea();
contain.add(txtarea);
for(int i=0; i dates = new ArrayList();
public ArrayList Finaldates = new ArrayList();
public void readFile(String filename)
{
BufferedReader br = null;
try {
String sCurrentLine;
br = new BufferedReader(new FileReader(filename));
while ((sCurrentLine = br.readLine()) != null) {
if(sCurrentLine.length() == 8)
{
dates.add(sCurrentLine);
}
else
{
if(sCurrentLine.contains(","))
{
String delim = ",";
StringTokenizer tokenizer = new StringTokenizer(sCurrentLine,delim);
while(tokenizer.hasMoreElements())
{
String nextElem = tokenizer.nextElement();
if(nextElem.length() == 8)
{
dates.add(nextElem);
}
else
{
System.out.println("Invalid String: "+nextElem);
}
}
}
else
{
System.out.println("Invalid String: "+sCurrentLine);
}
}
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (br != null)br.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
public void checkDates()
{
for(int i=0;i getArrayBeforeSorting()
{
return dates;
}
public ArrayList selectionSort()
{
for(int i=0; i

More Related Content

Similar to DateGUI.java import java.awt.; import javax.swing.;public .pdf

TextSearch
TextSearchTextSearch
TextSearch
Peeyush Ranjan
 
Selenium Webdriver with data driven framework
Selenium Webdriver with data driven frameworkSelenium Webdriver with data driven framework
Selenium Webdriver with data driven framework
David Rajah Selvaraj
 
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdfimport java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
venkt12345
 
Junit 5 - Maior e melhor
Junit 5 - Maior e melhorJunit 5 - Maior e melhor
Junit 5 - Maior e melhor
Tiago de Freitas Lima
 
import java.awt.FlowLayout;import java.awt.event.KeyEvent;import.pdf
import java.awt.FlowLayout;import java.awt.event.KeyEvent;import.pdfimport java.awt.FlowLayout;import java.awt.event.KeyEvent;import.pdf
import java.awt.FlowLayout;import java.awt.event.KeyEvent;import.pdf
galagirishp
 
Jggug 2010 330 Grails 1.3 観察
Jggug 2010 330 Grails 1.3 観察Jggug 2010 330 Grails 1.3 観察
Jggug 2010 330 Grails 1.3 観察
Tsuyoshi Yamamoto
 
201913046 wahyu septiansyah network programing
201913046 wahyu septiansyah network programing201913046 wahyu septiansyah network programing
201913046 wahyu septiansyah network programing
wahyuseptiansyah
 
A topology of memory leaks on the JVM
A topology of memory leaks on the JVMA topology of memory leaks on the JVM
A topology of memory leaks on the JVM
Rafael Winterhalter
 
Java practice programs for beginners
Java practice programs for beginnersJava practice programs for beginners
Java practice programs for beginners
ishan0019
 
Androidaop 170105090257
Androidaop 170105090257Androidaop 170105090257
Androidaop 170105090257
newegg
 
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
 
9.Spring DI_4
9.Spring DI_49.Spring DI_4
Jersey Guice AOP
Jersey Guice AOPJersey Guice AOP
Jersey Guice AOP
Domenico Briganti
 
Server1
Server1Server1
Server1
FahriIrawan3
 
ViewerFrame.java import javax.swing.JFrame;public class Viewer.pdf
ViewerFrame.java import javax.swing.JFrame;public class Viewer.pdfViewerFrame.java import javax.swing.JFrame;public class Viewer.pdf
ViewerFrame.java import javax.swing.JFrame;public class Viewer.pdf
annaindustries
 
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
AliHaiderCheema2
 
XTW_Import
XTW_ImportXTW_Import
XTW_Import
Luther Quinn
 
DCN Practical
DCN PracticalDCN Practical
DCN Practical
Niraj Bharambe
 
Oop lecture9 12
Oop lecture9 12Oop lecture9 12
Oop lecture9 12
Shahriar Robbani
 
CodeZipButtonDemo.javaCodeZipButtonDemo.java Demonstrate a p.docx
CodeZipButtonDemo.javaCodeZipButtonDemo.java Demonstrate a p.docxCodeZipButtonDemo.javaCodeZipButtonDemo.java Demonstrate a p.docx
CodeZipButtonDemo.javaCodeZipButtonDemo.java Demonstrate a p.docx
mary772
 

Similar to DateGUI.java import java.awt.; import javax.swing.;public .pdf (20)

TextSearch
TextSearchTextSearch
TextSearch
 
Selenium Webdriver with data driven framework
Selenium Webdriver with data driven frameworkSelenium Webdriver with data driven framework
Selenium Webdriver with data driven framework
 
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdfimport java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
import java.awt.Color;import java.awt.Insets;import java.awt.Con.pdf
 
Junit 5 - Maior e melhor
Junit 5 - Maior e melhorJunit 5 - Maior e melhor
Junit 5 - Maior e melhor
 
import java.awt.FlowLayout;import java.awt.event.KeyEvent;import.pdf
import java.awt.FlowLayout;import java.awt.event.KeyEvent;import.pdfimport java.awt.FlowLayout;import java.awt.event.KeyEvent;import.pdf
import java.awt.FlowLayout;import java.awt.event.KeyEvent;import.pdf
 
Jggug 2010 330 Grails 1.3 観察
Jggug 2010 330 Grails 1.3 観察Jggug 2010 330 Grails 1.3 観察
Jggug 2010 330 Grails 1.3 観察
 
201913046 wahyu septiansyah network programing
201913046 wahyu septiansyah network programing201913046 wahyu septiansyah network programing
201913046 wahyu septiansyah network programing
 
A topology of memory leaks on the JVM
A topology of memory leaks on the JVMA topology of memory leaks on the JVM
A topology of memory leaks on the JVM
 
Java practice programs for beginners
Java practice programs for beginnersJava practice programs for beginners
Java practice programs for beginners
 
Androidaop 170105090257
Androidaop 170105090257Androidaop 170105090257
Androidaop 170105090257
 
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
 
9.Spring DI_4
9.Spring DI_49.Spring DI_4
9.Spring DI_4
 
Jersey Guice AOP
Jersey Guice AOPJersey Guice AOP
Jersey Guice AOP
 
Server1
Server1Server1
Server1
 
ViewerFrame.java import javax.swing.JFrame;public class Viewer.pdf
ViewerFrame.java import javax.swing.JFrame;public class Viewer.pdfViewerFrame.java import javax.swing.JFrame;public class Viewer.pdf
ViewerFrame.java import javax.swing.JFrame;public class Viewer.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
 
XTW_Import
XTW_ImportXTW_Import
XTW_Import
 
DCN Practical
DCN PracticalDCN Practical
DCN Practical
 
Oop lecture9 12
Oop lecture9 12Oop lecture9 12
Oop lecture9 12
 
CodeZipButtonDemo.javaCodeZipButtonDemo.java Demonstrate a p.docx
CodeZipButtonDemo.javaCodeZipButtonDemo.java Demonstrate a p.docxCodeZipButtonDemo.javaCodeZipButtonDemo.java Demonstrate a p.docx
CodeZipButtonDemo.javaCodeZipButtonDemo.java Demonstrate a p.docx
 

More from deepua8

Balancing ANY chemical equation is done exactly t.pdf
                     Balancing ANY chemical equation is done exactly t.pdf                     Balancing ANY chemical equation is done exactly t.pdf
Balancing ANY chemical equation is done exactly t.pdf
deepua8
 
36.Kovacs reagent is used in Indole test. Kovacs reagent is 4 (p)-.pdf
36.Kovacs reagent is used in Indole test. Kovacs reagent is 4 (p)-.pdf36.Kovacs reagent is used in Indole test. Kovacs reagent is 4 (p)-.pdf
36.Kovacs reagent is used in Indole test. Kovacs reagent is 4 (p)-.pdf
deepua8
 
10.Real number1.Baseb. Consists of a set and rule for combining2.Bin.pdf
10.Real number1.Baseb. Consists of a set and rule for combining2.Bin.pdf10.Real number1.Baseb. Consists of a set and rule for combining2.Bin.pdf
10.Real number1.Baseb. Consists of a set and rule for combining2.Bin.pdf
deepua8
 
1. Yeasts grow by budding. The cell buds and separates into 2 cells..pdf
1. Yeasts grow by budding. The cell buds and separates into 2 cells..pdf1. Yeasts grow by budding. The cell buds and separates into 2 cells..pdf
1. Yeasts grow by budding. The cell buds and separates into 2 cells..pdf
deepua8
 
1. 252.125Solution1. 252.125.pdf
1. 252.125Solution1. 252.125.pdf1. 252.125Solution1. 252.125.pdf
1. 252.125Solution1. 252.125.pdf
deepua8
 
(B) 0.815Solution(B) 0.815.pdf
(B) 0.815Solution(B) 0.815.pdf(B) 0.815Solution(B) 0.815.pdf
(B) 0.815Solution(B) 0.815.pdf
deepua8
 
Suppose AFnSolution Suppose AFn.pdf
 Suppose  AFnSolution Suppose  AFn.pdf Suppose  AFnSolution Suppose  AFn.pdf
Suppose AFnSolution Suppose AFn.pdf
deepua8
 
C code on linked list #include stdio.h #include stdlib.h.pdf
 C code on linked list #include stdio.h #include stdlib.h.pdf C code on linked list #include stdio.h #include stdlib.h.pdf
C code on linked list #include stdio.h #include stdlib.h.pdf
deepua8
 
Definition of Log-Normal DistributionA statistical distr.pdf
  Definition of Log-Normal DistributionA statistical distr.pdf  Definition of Log-Normal DistributionA statistical distr.pdf
Definition of Log-Normal DistributionA statistical distr.pdf
deepua8
 
Step1 NaOH (aq) ----- Na(+)(aq) + Cl(-)(aq) Ste.pdf
                     Step1 NaOH (aq) ----- Na(+)(aq) + Cl(-)(aq)  Ste.pdf                     Step1 NaOH (aq) ----- Na(+)(aq) + Cl(-)(aq)  Ste.pdf
Step1 NaOH (aq) ----- Na(+)(aq) + Cl(-)(aq) Ste.pdf
deepua8
 
The compounds with low oxidation states (O.S.) be.pdf
                     The compounds with low oxidation states (O.S.) be.pdf                     The compounds with low oxidation states (O.S.) be.pdf
The compounds with low oxidation states (O.S.) be.pdf
deepua8
 
A) ionic compounds generally formed between the c.pdf
                     A) ionic compounds generally formed between the c.pdf                     A) ionic compounds generally formed between the c.pdf
A) ionic compounds generally formed between the c.pdf
deepua8
 
A ethers ethers contain R-O-R linkage not carbony.pdf
                     A ethers ethers contain R-O-R linkage not carbony.pdf                     A ethers ethers contain R-O-R linkage not carbony.pdf
A ethers ethers contain R-O-R linkage not carbony.pdf
deepua8
 
The fact that a molecule vibrates does not in its.pdf
                     The fact that a molecule vibrates does not in its.pdf                     The fact that a molecule vibrates does not in its.pdf
The fact that a molecule vibrates does not in its.pdf
deepua8
 
The compounds of interest are Na2S and H2SO4. Th.pdf
                     The compounds of interest are Na2S and H2SO4.  Th.pdf                     The compounds of interest are Na2S and H2SO4.  Th.pdf
The compounds of interest are Na2S and H2SO4. Th.pdf
deepua8
 
sucrose has a formula of C12H22O11while ammonia h.pdf
                     sucrose has a formula of C12H22O11while ammonia h.pdf                     sucrose has a formula of C12H22O11while ammonia h.pdf
sucrose has a formula of C12H22O11while ammonia h.pdf
deepua8
 
reduction strength Fe Pb As .pdf
                     reduction strength Fe  Pb  As                 .pdf                     reduction strength Fe  Pb  As                 .pdf
reduction strength Fe Pb As .pdf
deepua8
 
sp3d since it has 1s 3p and 1d orbitals available.pdf
                     sp3d since it has 1s 3p and 1d orbitals available.pdf                     sp3d since it has 1s 3p and 1d orbitals available.pdf
sp3d since it has 1s 3p and 1d orbitals available.pdf
deepua8
 
No standard potential data given. .pdf
                     No standard potential data given.                .pdf                     No standard potential data given.                .pdf
No standard potential data given. .pdf
deepua8
 
x2 + 4xSolutionx2 + 4x.pdf
x2 + 4xSolutionx2 + 4x.pdfx2 + 4xSolutionx2 + 4x.pdf
x2 + 4xSolutionx2 + 4x.pdf
deepua8
 

More from deepua8 (20)

Balancing ANY chemical equation is done exactly t.pdf
                     Balancing ANY chemical equation is done exactly t.pdf                     Balancing ANY chemical equation is done exactly t.pdf
Balancing ANY chemical equation is done exactly t.pdf
 
36.Kovacs reagent is used in Indole test. Kovacs reagent is 4 (p)-.pdf
36.Kovacs reagent is used in Indole test. Kovacs reagent is 4 (p)-.pdf36.Kovacs reagent is used in Indole test. Kovacs reagent is 4 (p)-.pdf
36.Kovacs reagent is used in Indole test. Kovacs reagent is 4 (p)-.pdf
 
10.Real number1.Baseb. Consists of a set and rule for combining2.Bin.pdf
10.Real number1.Baseb. Consists of a set and rule for combining2.Bin.pdf10.Real number1.Baseb. Consists of a set and rule for combining2.Bin.pdf
10.Real number1.Baseb. Consists of a set and rule for combining2.Bin.pdf
 
1. Yeasts grow by budding. The cell buds and separates into 2 cells..pdf
1. Yeasts grow by budding. The cell buds and separates into 2 cells..pdf1. Yeasts grow by budding. The cell buds and separates into 2 cells..pdf
1. Yeasts grow by budding. The cell buds and separates into 2 cells..pdf
 
1. 252.125Solution1. 252.125.pdf
1. 252.125Solution1. 252.125.pdf1. 252.125Solution1. 252.125.pdf
1. 252.125Solution1. 252.125.pdf
 
(B) 0.815Solution(B) 0.815.pdf
(B) 0.815Solution(B) 0.815.pdf(B) 0.815Solution(B) 0.815.pdf
(B) 0.815Solution(B) 0.815.pdf
 
Suppose AFnSolution Suppose AFn.pdf
 Suppose  AFnSolution Suppose  AFn.pdf Suppose  AFnSolution Suppose  AFn.pdf
Suppose AFnSolution Suppose AFn.pdf
 
C code on linked list #include stdio.h #include stdlib.h.pdf
 C code on linked list #include stdio.h #include stdlib.h.pdf C code on linked list #include stdio.h #include stdlib.h.pdf
C code on linked list #include stdio.h #include stdlib.h.pdf
 
Definition of Log-Normal DistributionA statistical distr.pdf
  Definition of Log-Normal DistributionA statistical distr.pdf  Definition of Log-Normal DistributionA statistical distr.pdf
Definition of Log-Normal DistributionA statistical distr.pdf
 
Step1 NaOH (aq) ----- Na(+)(aq) + Cl(-)(aq) Ste.pdf
                     Step1 NaOH (aq) ----- Na(+)(aq) + Cl(-)(aq)  Ste.pdf                     Step1 NaOH (aq) ----- Na(+)(aq) + Cl(-)(aq)  Ste.pdf
Step1 NaOH (aq) ----- Na(+)(aq) + Cl(-)(aq) Ste.pdf
 
The compounds with low oxidation states (O.S.) be.pdf
                     The compounds with low oxidation states (O.S.) be.pdf                     The compounds with low oxidation states (O.S.) be.pdf
The compounds with low oxidation states (O.S.) be.pdf
 
A) ionic compounds generally formed between the c.pdf
                     A) ionic compounds generally formed between the c.pdf                     A) ionic compounds generally formed between the c.pdf
A) ionic compounds generally formed between the c.pdf
 
A ethers ethers contain R-O-R linkage not carbony.pdf
                     A ethers ethers contain R-O-R linkage not carbony.pdf                     A ethers ethers contain R-O-R linkage not carbony.pdf
A ethers ethers contain R-O-R linkage not carbony.pdf
 
The fact that a molecule vibrates does not in its.pdf
                     The fact that a molecule vibrates does not in its.pdf                     The fact that a molecule vibrates does not in its.pdf
The fact that a molecule vibrates does not in its.pdf
 
The compounds of interest are Na2S and H2SO4. Th.pdf
                     The compounds of interest are Na2S and H2SO4.  Th.pdf                     The compounds of interest are Na2S and H2SO4.  Th.pdf
The compounds of interest are Na2S and H2SO4. Th.pdf
 
sucrose has a formula of C12H22O11while ammonia h.pdf
                     sucrose has a formula of C12H22O11while ammonia h.pdf                     sucrose has a formula of C12H22O11while ammonia h.pdf
sucrose has a formula of C12H22O11while ammonia h.pdf
 
reduction strength Fe Pb As .pdf
                     reduction strength Fe  Pb  As                 .pdf                     reduction strength Fe  Pb  As                 .pdf
reduction strength Fe Pb As .pdf
 
sp3d since it has 1s 3p and 1d orbitals available.pdf
                     sp3d since it has 1s 3p and 1d orbitals available.pdf                     sp3d since it has 1s 3p and 1d orbitals available.pdf
sp3d since it has 1s 3p and 1d orbitals available.pdf
 
No standard potential data given. .pdf
                     No standard potential data given.                .pdf                     No standard potential data given.                .pdf
No standard potential data given. .pdf
 
x2 + 4xSolutionx2 + 4x.pdf
x2 + 4xSolutionx2 + 4x.pdfx2 + 4xSolutionx2 + 4x.pdf
x2 + 4xSolutionx2 + 4x.pdf
 

Recently uploaded

writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 

Recently uploaded (20)

writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 

DateGUI.java import java.awt.; import javax.swing.;public .pdf

  • 1. DateGUI.java import java.awt.*; import javax.swing.*; public class DateGUI extends JFrame{ DateGUI() { //getting the arraylist Project1 proj = new Project1(); proj.readFile("C:filename"); proj.checkDates(); ArrayList dates = proj.selectionSort(); ArrayList beforeSortArray = proj.getArrayBeforeSorting(); //GUI code JFrame frame = new JFrame("Exam"); frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE); frame.setSize(500,600); // don't mix Swing with AWT JPanel contain = new JPanel(); System.out.println(contain.getLayout()); frame.setContentPane(contain); contain.setLayout(new GridLayout(1,2)); JTextArea txtarea = new JTextArea(); contain.add(txtarea); for(int i=0; i dates = new ArrayList(); public ArrayList Finaldates = new ArrayList(); public void readFile(String filename) { BufferedReader br = null; try { String sCurrentLine; br = new BufferedReader(new FileReader(filename)); while ((sCurrentLine = br.readLine()) != null) { if(sCurrentLine.length() == 8) {
  • 2. dates.add(sCurrentLine); } else { if(sCurrentLine.contains(",")) { String delim = ","; StringTokenizer tokenizer = new StringTokenizer(sCurrentLine,delim); while(tokenizer.hasMoreElements()) { String nextElem = tokenizer.nextElement(); if(nextElem.length() == 8) { dates.add(nextElem); } else { System.out.println("Invalid String: "+nextElem); } } } else { System.out.println("Invalid String: "+sCurrentLine); } } } } catch (IOException e) { e.printStackTrace(); } finally { try { if (br != null)br.close(); } catch (IOException ex) { ex.printStackTrace(); } }
  • 3. } public void checkDates() { for(int i=0;i getArrayBeforeSorting() { return dates; } public ArrayList selectionSort() { for(int i=0; i Solution DateGUI.java import java.awt.*; import javax.swing.*; public class DateGUI extends JFrame{ DateGUI() { //getting the arraylist Project1 proj = new Project1(); proj.readFile("C:filename"); proj.checkDates(); ArrayList dates = proj.selectionSort(); ArrayList beforeSortArray = proj.getArrayBeforeSorting(); //GUI code JFrame frame = new JFrame("Exam"); frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE); frame.setSize(500,600); // don't mix Swing with AWT JPanel contain = new JPanel(); System.out.println(contain.getLayout()); frame.setContentPane(contain); contain.setLayout(new GridLayout(1,2)); JTextArea txtarea = new JTextArea();
  • 4. contain.add(txtarea); for(int i=0; i dates = new ArrayList(); public ArrayList Finaldates = new ArrayList(); public void readFile(String filename) { BufferedReader br = null; try { String sCurrentLine; br = new BufferedReader(new FileReader(filename)); while ((sCurrentLine = br.readLine()) != null) { if(sCurrentLine.length() == 8) { dates.add(sCurrentLine); } else { if(sCurrentLine.contains(",")) { String delim = ","; StringTokenizer tokenizer = new StringTokenizer(sCurrentLine,delim); while(tokenizer.hasMoreElements()) { String nextElem = tokenizer.nextElement(); if(nextElem.length() == 8) { dates.add(nextElem); } else { System.out.println("Invalid String: "+nextElem); } } } else { System.out.println("Invalid String: "+sCurrentLine);
  • 5. } } } } catch (IOException e) { e.printStackTrace(); } finally { try { if (br != null)br.close(); } catch (IOException ex) { ex.printStackTrace(); } } } public void checkDates() { for(int i=0;i getArrayBeforeSorting() { return dates; } public ArrayList selectionSort() { for(int i=0; i