Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3acfaaa

Browse files
committed
updated and fixed some bugs
1 parent 8e446c0 commit 3acfaaa

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

‎Sorting.java‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,16 @@ public class Sorting extends Main {
7070

7171
class ListenerClass implements ActionListener {
7272
public void actionPerformed(ActionEvent e) {
73-
if (e.getSource() == jbtRandomize)
74-
System.out.println("jbtRandomize button clicked");
73+
if (e.getSource() == jbtRandomize) {
74+
sortAlgo.initShuffler();
75+
}
7576
else if (e.getSource() == jbtMerge)
7677
System.out.println("jbtMerge button clicked");
7778
else if (e.getSource() == jbtBubble)
7879
System.out.println("jbtBubble button clicked");
7980
else if (e.getSource() == jbtInsertion) {
80-
sortAlgo.startSorting(); // Sorting algotithm
81+
sortAlgo.initSorter(); // Sorting algotithm
82+
sortAlgo.initShuffler();
8183
}
8284
else if (e.getSource() == jbtSelection)
8385
System.out.println("jbtSelection button clicked");

‎SortingAlgorithm.java‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ public class SortingAlgorithm extends JPanel {
2020
setBackground(Color.BLACK);
2121
setPreferredSize(new Dimension(WIDTH, HEIGHT));
2222
initBarHeight(); // initialize the height of each bar
23-
//initSorter();
24-
initShuffler();
25-
}
26-
27-
public void startSorting() {
28-
initSorter();
2923
initShuffler();
3024
}
3125

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /