-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocessInput.java
More file actions
81 lines (71 loc) · 2.58 KB
/
processInput.java
File metadata and controls
81 lines (71 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package sortingalgojava;
import java.awt.event.*;
import javax.swing.JFrame;
/**
*
* @author marck
*/
public class processInput extends drawUI {
int inputs [] = new int [10];
public static void main(String[] args) {
drawIT();
}
@Override
public void actionPerformed(ActionEvent ae) {
Object press = ae.getSource();
if(press == sort){
txtarea.setText("");
pass = 0;
if(handler.blank() == false && handler.notNum() == false){
for(loop=0; loop<inputs.length; loop++)
inputs [loop] = Integer.parseInt(txtin[loop].getText());
if(insertion.isSelected()== true){
sortLabel.setText(" sorted numbers using Insertion Sort");
Algo.insertion(inputs, inputs.length);
for(loop=0;loop<inputs.length; loop++)
txtout[loop].setText(""+inputs[loop]);
}
if(bubble.isSelected()== true){
sortLabel.setText(" sorted numbers using Bubble Sort");
Algo.bubble(inputs, inputs.length);
for(loop=0;loop<inputs.length; loop++)
txtout[loop].setText(""+inputs[loop]);
}
if(merge.isSelected()== true){
sortLabel.setText(" sorted numbers using Merge Sort");
Algo.Merge(inputs, inputs.length);
for(loop=0;loop<inputs.length; loop++)
txtout[loop].setText(""+inputs[loop]);
}
}else
sortLabel.setText(""+warning);
}
if(press == deletebtn){
for(loop = 0; loop<txtin.length;loop++){
txtin[loop].setText("");
txtout[loop].setText("");
}
sortLabel.setText("");
passNum.setText("");
execTime.setText("");
txtarea.setText("");
mainpanel.updateUI();
}
}
@Override
public void keyTyped(KeyEvent ke) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void keyPressed(KeyEvent ke) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public void keyReleased(KeyEvent ke) {
throw new UnsupportedOperationException("Not supported yet.");
}
}