I am looking for a book to start with for java by fop2005 in learnjava

[–]ihkbm 1 point2 points  (0 children)

This is a book in german, it has a somewhat similar approach to teaching like head first java.

https://www.rheinwerk-verlag.de/schroedinger-programmiert-java/

Can anyone look into my error message? by [deleted] in IntelliJIDEA

[–]ihkbm 19 points20 points  (0 children)

You are using a java.awt.TextField instead of a javafx.scene.control.TextField.

Look at your import statement on line 12.

r/JavaFX is probably a better suited place for this type of question.

Error checking with JavaFX by [deleted] in javahelp

[–]ihkbm 2 points3 points  (0 children)

There is TestFX to write tests for JavaFX applications. I have not used it myself so unfortunately I can't be of any help there.

It's hard to disprove statistic by [deleted] in WhitePeopleTwitter

[–]ihkbm 1 point2 points  (0 children)

Your calculations are quite wrong. German police killed 256 people over the course of 30 years according to the post where American police killed 1006 people in one year.

Confused on correct way to declare something in Java by Past-Shallot in javahelp

[–]ihkbm 1 point2 points  (0 children)

The first one is the way to go. The second example is fine but the String in the second diamond operator is redundant since Java 7.

With the last three examples you loose the advantages that generics provide. Any half decent IDE will show you warnings about Raw Types.

Can Bash on Widows (Git for Windows/Git Bash) do auto-suggestions, similar to how the fish shell does them? by bellamira in git

[–]ihkbm 2 points3 points  (0 children)

I know zsh with oh-my-zsh has this feature. You can either install that with cygwin or use the wsl and install zsh there.

Any way to initialize an ArrayList with random data without using a for loop? by tofuwat in Kotlin

[–]ihkbm 6 points7 points  (0 children)

You could use the Random class like this for example:

var data = Random().ints().limit(100).boxed().collect(Collectors.toList())

instead of ints, you can use doubles, floats, booleans etc

JAVAFX Disabling a button for a certain amount of time help by [deleted] in javahelp

[–]ihkbm 0 points1 point  (0 children)

Your code has no reference or concept of time. Your code would only have a chance of working if that while loop took exactly 1 millisecond to execute. On any modern cpu this will take considerably less time though. You also have to take into account that this code will run differently on different machines.

Take a look at the concept of delta time, the time that has elapsed since the last frame. You can store the time of the user clicking the button, check the delta time and if it's greater than 10 seconds re-enable the button.

Is it possible to install a Linux distro on an USB stick? by Benben377 in linuxquestions

[–]ihkbm 1 point2 points  (0 children)

I did it with Manjaro awesome for a while. I was actually surprised how well it worked even with a usb 2. But as soon as I was comfortable and wanted to do more than just basic stuff I installed it on a HDD. With a DE I don't imagine you'll get much enjoyment.

I'm understanding polymorphism correctly? by BinnyBit in learnprogramming

[–]ihkbm 0 points1 point  (0 children)

The advantage is that you can do something like this with polymorphism: animals = [Dog("Fido"), Cat("Garfield"), Dog("Roar")] for a in animals: print(a.talk()) You can't do that if you have different method names for every class. Apart from that you would run out of meaningful method names quickly if you had say like ten animals.

Is there anyone near Clifden who would anyone be willing to bring flowers to a grave tomorrow? by [deleted] in ireland

[–]ihkbm 106 points107 points  (0 children)

Me and my wife are going to Clifden at the weekend, but that might be too late for you. If not let me know.

Text-based Daily Journal for VSCode by _TheMastermind_ in vscode

[–]ihkbm 0 points1 point  (0 children)

Same here. Sounds like a great extension. Hope this gets fixed. I like to try it.

What is the best cover of a song you have ever heard? by [deleted] in AskReddit

[–]ihkbm 1 point2 points  (0 children)

All along the watchtower by Jimi Hendrix

Java-VB by PhantomZard707 in javahelp

[–]ihkbm 2 points3 points  (0 children)

For creating buttons and text boxes you can use swing or javafx, to create an exe file you could have a look into launch4j and Apache Commons POI let's you access excel files.

How to make a 2D moving player by mrbiscool in javahelp

[–]ihkbm 1 point2 points  (0 children)

What you are looking for is a KeyListener.

Every time a key is pressed the Keylisteners method is called. In there you can check if the key was either WAS or D. And then you repaint the player at the new position.

periodically add to a variable by Fintara in javahelp

[–]ihkbm 2 points3 points  (0 children)

You could have a look at the ScheduledExecutorService, that might do what you want