You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/main/application/randomGame.java
+81-5
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,12 @@
2
2
3
3
importjava.awt.Desktop;
4
4
5
+
importjavax.swing.ButtonGroup;
5
6
importjavax.swing.JEditorPane;
7
+
importjavax.swing.JLabel;
6
8
importjavax.swing.JOptionPane;
9
+
importjavax.swing.JPanel;
10
+
importjavax.swing.JRadioButton;
7
11
importjavax.swing.event.HyperlinkEvent;
8
12
importjavax.swing.event.HyperlinkListener;
9
13
@@ -22,26 +26,98 @@ public static void fullyRandom() {
22
26
}
23
27
24
28
publicstaticvoidrandomFromDeveloper() {
25
-
29
+
IntegerdevLegth = 0; StringwantedRandomDev;
30
+
wantedRandomDev = JOptionPane.showInputDialog(null, "Enter developer name you wish to search for:", "Random game from developer", JOptionPane.QUESTION_MESSAGE);
31
+
for (inti = 0; i < allGames.length; i++) {
32
+
if (allGames[i][3].equals(wantedRandomDev)) {
33
+
devLegth++;
34
+
}
35
+
}
36
+
if (devLegth == 0) { JOptionPane.showMessageDialog(null, "No games found from developer: "+wantedRandomDev, "Random game from developer", JOptionPane.INFORMATION_MESSAGE); return;}
if (engineLegth == 0) { JOptionPane.showMessageDialog(null, "No games found with engine: "+wantedRandomEngine, "Random game with engine", JOptionPane.INFORMATION_MESSAGE); return;}
if (siteLegth == 0) { JOptionPane.showMessageDialog(null, "No games found from site: "+wantedRandomSite, "Random game from site", JOptionPane.INFORMATION_MESSAGE); return;}
0 commit comments