SlideShare a Scribd company logo
1 of 5
Download to read offline
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

Selenium Webdriver with data driven framework
Selenium Webdriver with data driven frameworkSelenium Webdriver with data driven framework
Selenium Webdriver with data driven frameworkDavid 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.pdfvenkt12345
 
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.pdfgalagirishp
 
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 programingwahyuseptiansyah
 
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 JVMRafael Winterhalter
 
Java practice programs for beginners
Java practice programs for beginnersJava practice programs for beginners
Java practice programs for beginnersishan0019
 
Androidaop 170105090257
Androidaop 170105090257Androidaop 170105090257
Androidaop 170105090257newegg
 
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
 
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.pdfannaindustries
 
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docx
20-Arid-850 Ali Haider Cheema BSSE(5A) Evening MPL Assignement 08.docxAliHaiderCheema2
 
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.docxmary772
 

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.pdfdeepua8
 
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)-.pdfdeepua8
 
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.pdfdeepua8
 
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..pdfdeepua8
 
1. 252.125Solution1. 252.125.pdf
1. 252.125Solution1. 252.125.pdf1. 252.125Solution1. 252.125.pdf
1. 252.125Solution1. 252.125.pdfdeepua8
 
(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.pdfdeepua8
 
Suppose AFnSolution Suppose AFn.pdf
 Suppose  AFnSolution Suppose  AFn.pdf Suppose  AFnSolution Suppose  AFn.pdf
Suppose AFnSolution Suppose AFn.pdfdeepua8
 
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.pdfdeepua8
 
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.pdfdeepua8
 
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.pdfdeepua8
 
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.pdfdeepua8
 
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.pdfdeepua8
 
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.pdfdeepua8
 
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.pdfdeepua8
 
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.pdfdeepua8
 
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.pdfdeepua8
 
reduction strength Fe Pb As .pdf
                     reduction strength Fe  Pb  As                 .pdf                     reduction strength Fe  Pb  As                 .pdf
reduction strength Fe Pb As .pdfdeepua8
 
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.pdfdeepua8
 
No standard potential data given. .pdf
                     No standard potential data given.                .pdf                     No standard potential data given.                .pdf
No standard potential data given. .pdfdeepua8
 
x2 + 4xSolutionx2 + 4x.pdf
x2 + 4xSolutionx2 + 4x.pdfx2 + 4xSolutionx2 + 4x.pdf
x2 + 4xSolutionx2 + 4x.pdfdeepua8
 

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

TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhleson0603
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital ManagementMBA Assignment Experts
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMELOISARIVERA8
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxMohamed Rizk Khodair
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...EduSkills OECD
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppCeline George
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppCeline George
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxLimon Prince
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽中 央社
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxAdelaideRefugio
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxneillewis46
 

Recently uploaded (20)

TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptx
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 

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