Skip to content

Commit 3155eb6

Browse files
committed
Check immediately for javafx presense.
1 parent 29494e9 commit 3155eb6

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/java/com/javadeobfuscator/deobfuscator/ui/SwingWindow.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ public class SwingWindow
7171

7272
public static void main(String[] args)
7373
{
74+
try
75+
{
76+
Class.forName("javafx.stage.FileChooser");
77+
} catch (ClassNotFoundException e)
78+
{
79+
e.printStackTrace();
80+
ensureSwingLafLoaded();
81+
ExceptionUtil.showFatalError("You need a JVM with JavaFX (non-headless installation).\n\n" +
82+
"Could not find class " + e.getMessage());
83+
System.exit(1);
84+
return;
85+
}
7486
mainThread = Thread.currentThread();
7587
Thread loaderThread = new Thread("Deobfuscator Jar Loader Thread")
7688
{
@@ -93,7 +105,7 @@ public void run()
93105
{
94106
e.printStackTrace();
95107
ensureSwingLafLoaded();
96-
ExceptionUtil.showFatalError("You need a JVM with JavaFX (an non-headless installation).\n\n" +
108+
ExceptionUtil.showFatalError("You need a JVM with JavaFX (non-headless installation).\n\n" +
97109
"Could not find class " + e.getMessage());
98110
System.exit(1);
99111
}
@@ -551,7 +563,8 @@ public void actionPerformed(ActionEvent e)
551563
{
552564
int valI = indexesIter.get(i);
553565
int newIndex = valI - 1;
554-
if (blocked.contains(newIndex)) {
566+
if (blocked.contains(newIndex))
567+
{
555568
//if target index is blocked, we cannot move, so our index is blocked too
556569
blocked.add(valI);
557570
continue;
@@ -598,7 +611,8 @@ public void actionPerformed(ActionEvent e)
598611
{
599612
int valI = indexesIter.get(i);
600613
int newIndex = valI + 1;
601-
if (blocked.contains(newIndex)) {
614+
if (blocked.contains(newIndex))
615+
{
602616
//if target index is blocked, we cannot move, so our index is blocked too
603617
blocked.add(valI);
604618
continue;

0 commit comments

Comments
 (0)