Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] Screen is completely blank when running under Windows #190

Open
maxbrito500 opened this issue Sep 5, 2021 · 4 comments
Open

Comments

@maxbrito500
Copy link
Contributor

Hello,

When running the executable under Windows the frames for the app appear but they are completely invisible.

I've tried running with administrator rights and tried running from the command line, same result.

This was the output:
Loading config file contents

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.bulenkov.darcula.DarculaLaf (file:/C:/Users/maxbr/Downloads/miners/signa/btdex-v0.5.5-all.jar) to field javax.swing.text.html.HTMLEditorKit.DEFAULT_STYLES_KEY
WARNING: Please consider reporting this to the maintainers of com.bulenkov.darcula.DarculaLaf
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Would it be possible to simply revert to a default LAF when not able to display the intended one? On this case I just want to mine from the Windows machine, no need for the UI to be pretty. Thanks.

@jjos2372
Copy link
Collaborator

jjos2372 commented Sep 5, 2021

Hello, there is an issue with Java 16 and the LAF we are using. If you can use Java 8, 11, or 13 it should work.

@maxbrito500
Copy link
Contributor Author

OK, thanks for the guidance.

I've looked into the code to address this issue and would like to suggest a different LAF if you see possible. The FlatLaf in principle should work, I've tested and gets good results. Code follows:

Add the com.formdev:flatlaf dependencies on Gradle:

--- a/build.gradle
+++ b/build.gradle
@@ -31,6 +31,8 @@
     // implementation 'com.github.burst-apps-team:blocktalk:121e144cfe'   
     implementation 'com.github.signum-network:signum-smartj:1eb7a1587c' 
 
+    implementation 'com.formdev:flatlaf:1.5'
+    implementation 'com.formdev:flatlaf-intellij-themes:1.5'
     implementation 'com.google.code.gson:gson:2.8.6'
     implementation 'io.reactivex.rxjava2:rxjava:2.2.15'
     implementation 'com.squareup.okhttp3:okhttp:4.4.0'

And then add this LAF on the UI creator:

--- a/src/main/java/btdex/ui/Main.java
+++ b/src/main/java/btdex/ui/Main.java
@@ -51,7 +51,6 @@
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 
-import com.bulenkov.darcula.DarculaLaf;
 
 import btdex.core.BurstNode;
 import btdex.core.Constants;
@@ -404,7 +403,8 @@
 		// LafManager.install(new DarculaTheme()); //Specify the used theme.
 		// LafManager.getUserProperties().put(DarkTooltipUI.KEY_STYLE, DarkTooltipUI.VARIANT_PLAIN);
 		try {
-			DarculaLaf laf = new DarculaLaf();
+                        // list of themes at: https://github.com/JFormDesigner/FlatLaf/tree/main/flatlaf-intellij-themes
+                        com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatDraculaIJTheme laf = new com.formdev.flatlaf.intellijthemes.materialthemeuilite.FlatDraculaIJTheme();
 			UIManager.setLookAndFeel(laf);
 			logger.debug("UI manager {} created", laf.getDescription());
 		} catch (UnsupportedLookAndFeelException e) {

I've included the link for other themes, they are pre-installed. Perhaps possible to go through them and let users switch between day/night themes?

Many thanks.

@maxbrito500
Copy link
Contributor Author

Update. I run on Windows with OpenJDK8 and Oracle JDK8, same result.
Then tried with Java 11 from adoptium.net and same result.
I've downloaded the code on Windows to compile there and run, still same result.

My machine is a Windows 10 trial version. Normally wouldn't use Windows but on this machine is necessary to run other Windows-specific tools. Likely others are experiencing the same issue.

@jjos2372
Copy link
Collaborator

jjos2372 commented Sep 8, 2021

Add the com.formdev:flatlaf dependencies on Gradle:

Hello, I had this tested some time ago and tested the 1.5 version as you suggested just now. The problem is they don't have any border on the buttons, so they end up in different sizes, looking bad.

Please let me know if having this one works for you (it is commented out in the build.gradle file):
implementation 'com.github.jjos2372:Darcula:3b47831130'

PS. are you running from command line the java -jar btdex-all.jar just to be sure which java version is being used? Check with java -version first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants