4
u/SaggiSponge Aug 14 '20
Very cool! I've been wanting to do something like this for a while, but never found the motivation. Now that I've seen this, I might finally get around to making a chess GUI of my own.
1
2
u/oFamosoBiruley Aug 14 '20
Awesome!!! Congrats! Is that okay if I have a look on your github repo and try to do it as well, as practice? I learned Java, but I haven't learned javaFx yet.
2
u/SpeedDart1 Aug 14 '20
Of course, as long as you do not copy paste code
1
u/oFamosoBiruley Aug 14 '20
No copying and pasting. I just would love to learn javaFx as I have tried java Swing and I think Fx looks prettier. But thinking again, that's your project! I won't try to do the same. Maybe I come up with something else and just look at your repo to see how MVC works in javaFX. Anyways, thanks for sharing. Congratulations for your results! Impressive!!
30
11
9
2
u/madhakish Aug 13 '20
Why does every Java UI I've ever seen ever look like it was rendered in 1985 on a 386 with an 8 color pallette put together by a collaboration between a color blind manic depressive and coked up Easter bunny?
Just looking at some java interfaces makes me feel like I'm outside in the rain, standing in a puddle, in my socks, waiting for a bus that will never come.
Good job btw.
6
u/SpeedDart1 Aug 13 '20
Do you mean to say you don’t like it? What parts would you change?
12
u/madhakish Aug 13 '20
No, I do like it actually and checked out your git repo. Good readme, organized, we'll put together.
I'm speaking to the overall java UI frameworks over time just always sort of having the same weird, windows 95ish "theme" to them. Not even specifically the colors you chose although I'd maybe pick different default pallette myself.
Just something about java, I can't quite put my finger on it. For whatever reason they've always had a similar look/feel that without significant extra development time I just don't care for.
0
Aug 13 '20
[deleted]
3
u/madhakish Aug 14 '20
At least 2 dozen.. Great link, I dig quite a few of those actually. The Template Editor is very clean. Some of those astronomy apps a really sharp looking.
2
u/thuriot Aug 14 '20
Swing Metal lover too, can't live without jEdit, Netbeans, TrolCommander, JMeter, SqlWorkbench, Soapui, JFileSync, Jdownloader, Jmeld and so much others.
Nimbus and other nice LAFs can coexist.
Swing is consistent over platform and years (15 yrs old apps still working).
Oracle removed too much things from jvm (applets, javafx, nashorn) if they left swing for the GUI based on javascript (crappy unstable toy), il will be a pity.
In the same vein, Oracle put the pressure on Graalvm instead of Panama and JVMCI for optimisation, not all apps are for the cloud.
-10
u/sindisil Aug 13 '20
Ignore them. They're a worthless troll.
6
u/madhakish Aug 13 '20
Not trolling, just not a huge fan of java gui's in their stock form.
2
u/wildjokers Aug 14 '20
Swing picks a platform look and feel by default on every platform as far as I am aware. The platform look and feels look native. So I am not sure what you are talking about. JavaFX is completely style-able with a custom CSS syntax.
On the other hand Electron apps are the same jumbled mess with no delineation of sections (because layout in CSS is an afterthought) making usability a nightmare. As an example look no further than the settings "interface" of Visual Code Studio. It is an unusable abomination.
5
u/TheRedmanCometh Aug 13 '20
Google sexy java guis...some people have made some super cool stuff
3
u/madhakish Aug 13 '20
Don't get me wrong. It can be done.. but it seems as though out of the box they all carry a specific default look w/o basically overriding everything right off the get go or implementing something that reduces overall compatibility, etc.. Granted it's also been many years since I worked on anything gui related so I'm sure there are nice frameworks, pallettes, fonts packs etc making it easier to customize quickly.
It's gotten better..
Things like jconsole come to mind. It assaults my retinas everyday.
8
u/Muximori Aug 13 '20
If you write an electron gui without any css styling it will look terrible too.
2
u/madhakish Aug 13 '20
Sure.. I'm more referring to the specific "java-ey" look and feel that's persisted since the 90's, and harkens back to Solaris and X windows wm's of the day.
Long long ago I struggled with getting a not terrible looking java ui's to look anywhere close to similar across windows, Mac, and Linux. It just never did.. The ridiculous hoops required to coordinate that level of consistency across platforms put a bad taste in my mouth. This was java 1.4-1.6 era and just sucked to deal with.
1
u/wildjokers Aug 14 '20
Things like jconsole come to mind. It assaults my retinas everyday.
It looks pretty native to me on MacOS:
https://i.imgur.com/VWgm3qA.png
What's wrong with it?
0
Aug 13 '20
[deleted]
3
u/madhakish Aug 14 '20
This is a phenomenal explanation. And yes, that's basically my gripe is that the same kind of bland/dated defaults continues to persist without making a dedicated effort to design a UI and write the code.
Swing was even a step up from the early days, at least the fonts aren't all atrocious, but yeah.
This is an interesting topic for OP to ponder. To UX, or not to UX. Beautiful interfaces are nice to use and can increase the usefulness of the thing your building, making it more pleasurable and attractive - but at a cost of time, design skill, etc.
3
Aug 14 '20
whatever looked good yesterday looks outdated today and will look even more outdated tomorrow.
This is only true if the author did nothing, so Swing would select the "cross platform look and feel" (which defaults to the Metal LnF in older Versions and the obnoxious Nimbus LnF in newer versions).
A single line of Java code has always made a Swing GUI look very much like a native application:
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());0
Aug 14 '20
[deleted]
1
Aug 14 '20
Which platforms? On Windows 10, the application looks like a Windows 10 application (with the exception of e.g. the FileOpenDialog)
3
u/canuck_in_wa Aug 14 '20
Any GUI that loads quickly, is responsive, is not cluttered, resists tons of skeuomorphic BS or hipster flat design and just gets out of your way to focus on the content is good in my books. I think OP’s GUI looks great!
2
u/_INTER_ Aug 14 '20
Though the Java UI technologies (at least Swing or JavaFX) allow modern design. IntelliJ, GoliathOUFX or these are examples. There are also libraries that help you like JFoenix.
The thing is that the defaults try to be as close to native as possible which automatically gives you a more "outdated" look and feel. It takes a UX/UI designer from the start to guide a project towards more recent designs. Otherwise the everyday software engineer can't be bothered with pixel-moving.
1
u/apleaux Nov 12 '20
Those links you submitted look great but I am trying figure out what technologies your referencing that help you design like that? Where those both made using JFoenix?
0
u/thepobv Aug 14 '20
Because we're accustomed to very powerful FE webapps.
Angular or React is built for UI/UX... I feel like Java is more of "gets the job done if needed"
1
u/madhakish Aug 14 '20
The vast majority of java in my field is headless, you're right. 99+% is react or angular or some other web UI framework.
I've worked on some Java UI's but they always suffered the same problem in the GUI - lots of effort to stylize and get away from the bone stock look, and then another good chunk of effort to ensure it was consistent from OS to OS and version to version to the degree that a built-in java was always bundled w/ the app to ensure version compatibility at the cost of bloating an otherwise small jar into a full jvm bundle.
I'll readily admit - I have not used JavaFX, and my past experience may simply be jaded because I'm old and grumpy now.
4
u/gatorstar Aug 14 '20
Great work there!!
Java pays my bill and it's one language which I know inside and out. Unfortunately, current situation of building GUI is lackluster. JavaFX never took off like other frameworks. Tried few times in past but I was always worried about it'll be left out to die. Also, I don't know why GUI feels like it stuck in 1990s. Only Java based GUI app I'm using is IntelliJ which works decently, I guess that's because there is tons of work done to make it work but it's slow compared to native or C++ QT.
2
u/Goel40 Aug 14 '20
Have you heard about Scene Builder? You can built GUI's with that crazy fast using <FXML>. You can even set it up as a plugin for inteliJ.
1
u/gatorstar Aug 15 '20
Scene Builder
yes, I do. If I'm correct initially it was built by Oracle and then they gave way or just open sourced so that it would be kept alive. Currently, maintained by a company and who knows when they will close the shop. Also, I feel building GUI apps using any automated tool may not scale that very well.
3
u/Goel40 Aug 15 '20
I've used it on building a multi window, multi scene project with lots of tabs. So In my experience it's pretty scalable. Just takes a bit of practice. But after that i could make new GUI's super fast.
1
u/OnlyProductiveSubs Aug 14 '20
Have you managed to create a single runnable file from your project? I can't manage to get a working file going from my project, exe or jar.
1
u/SpeedDart1 Aug 14 '20
Yes, I have a .jar file in the dist directory.
I also have a packaged folder with exe, jar, and jre for non java users.
If you have trouble making exe try launch4j.
2
u/Dsempatao Aug 15 '20
I cloned your git and tried to launch the jar from Ubuntu, but got this error:
java -jar ChessLite.jar
Error: Could not find or load main class gui.ChessLite
1
u/SpeedDart1 Aug 15 '20 edited Aug 15 '20
My friend using Linux had the same problem but it was fixed by reinstalling OpenJDK. At the time I thought it was an issue on his end but I’m considering that it may have to do with the way I created the jar. I will look into this. However it has worked on Mac and windows with no issues so far.
Update: The default JRE for Ubuntu doesn’t have JavaFX. To properly run you will need a newer JavaFX run time or specifically use the packaged Exe file I have in the zip file contained in dist.
Msg me if you are able to get it working.
3
Aug 14 '20
Nice job!
I remember when I did this in uni... I was selling projects to other students (I was poor). It had PvP mode, 2 PvC modes and a CvC mode (to train the algorithm). I had no idea of neural networks, I just used statistics which did the job and was ok-ish, but just dumb.
1
u/liquid153 Aug 13 '20
Looks like you just used lichess
3
u/SpeedDart1 Aug 13 '20 edited Nov 14 '20
No I wrote the code myself (the only dependency is JavaFX) but the images aren’t mine, I should clarify.
Other than that it is original, you should check out the source code 👍
1
u/madhakish Aug 13 '20
They're referring to the icons and default layout most likely which is pretty close to lichess default look. Icons are very close in style.
1
u/rp_ush Aug 13 '20
Looks mildly different, such as the table with info and the piece set in lichess that is closest is still slightly different
2
u/madhakish Aug 13 '20
Yeah definitely a close approximation. If I'm the author of lichess though - this would be a compliment to have someone use my design and layout to teach themselves programming.
2
2
2
2
1
u/Clitaurius Aug 14 '20
I would suggest showing the captured pieces above/below the timer and move log.
1
Aug 15 '20
Where does everyone here read documentation for modern JavaFX? I had the hardest time even getting a program to compile recently, but finally got it to work. I always run into the issue that FX doesn't seem as well documented as Swing
2
Aug 15 '20
I think the easiest way to start out would be to use the Netbeans Maven JavaFX template and just upgrade the JavaFX version numbers to 14.0.2. I used this tutorial: http://zetcode.com/gui/javafx/
I think the hardest thing about JavaFX though is that it isn't a really opinionated framework. It's up to you to establish component lifecycles, MVVM vs MVC, etc.
4
u/kevin7254 Aug 13 '20
Nice job! I’m studying Java myself. Some questions. For how long have you been studying? Are you self taught? How did you find motivation in the start?
Thanks!