First of all, sorry for my english! I have a problem, I´m trying to make a simple java videogame, and I make booleans for the inputs. The inputs works well, but when I try to update the booleans in another class, it doesnt work. I put here the important classes I put all the classes in this drive. Classes I
Tag: boolean
Nimbus takes precedence over manually defined renderer?
Making a GUI in Swing (NetBeans 15, Sun JDK 19.0.1), i’m trying to set custom background color for JTable rows and encountered issues with boolean cells, and i can’t seem to be able to make the background uniform across all cells. Please note that the following code tries to paint the background for the whole table, but my target is
How to call an 2D – Array which was iniciated in another class?
I made a minimal reduced example of my problem: The Maze class creates a 2D Boolean Array with the Method generateMaze() (The content of mazeArray is irrelevant in this example). The main-Thread from Walker calls that Method and thereby creates this mazeArray from the Maze-class. I do not understand how I can call this Array in Walker.walk? Im affraid I
How to check if a traversion has reached a certain Index in a 2D-Array in Java?
Let’s say we have a 2D-boolean Array as a presentation of a maze, the size of the Array is not fixed and random. The walls are depicted as true: The exit of the maze is at a fixed Index. How can I check wether the traversion has reached this certain index or not? My idea was to create an int[
JPA repository Boolean Query – return null pointer exception
I have Java springBoot project With repository that included boolean custom query. but the system run to null pointer exception apart from return “false”. this is the query: I called the method: and this is the error: Answer Your query is designed to return whatever entity (called CustomersVsCoupons from now on) is mapped to the table customer_vs_coupons, not a Boolean.
Java Boolean method return is always false [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 9 months ago. Improve this question
Are booleans implicitly true?
I’m a bit confused on this bit of code. My professor explained that the output will always be true but I’m confused on why. I changed the boolean to both true and false but the output is always true and I’m having a hard time explaining the logic behind it. I assumed that since a false && true will always
The method countTrue(boolean[]) in the type GUI is not applicable for the arguments (boolean, boolean, boolean, boolean, boolean)
this is the error : “The method countTrue(boolean[]) in the type GUI is not applicable for the arguments (boolean, boolean, boolean, boolean, boolean)” , the error is in the last line , but i dont get why. Answer New array should be declared as below: int x = GUI.countTrue(new boolean[]{true, false, false, true, false}); OR you can use varargs and
simple java program returning incorrect value
Hello I am brushing up on Java practice. I have this very simple program: There are two int values, along with a boolean variable. i) The program will return true if one of these values is negative and one is positive. ii) However, if the boolean variable is true, the program can only return true if both int values are
Prevent Spring from prefixing booleans with is only in certain cases
I have an object with a boolean property called hasEnoughBalance, but Spring (or Lombok, or whoever it is) appears to be renaming the getter to isHasEnoughBalance instead of getHasEnoughBalance or plain hasEnoughBalance. How could I prevent that? I know of @JsonProperty, but I’d like another solution if possible. Answer This is being done by Lombok. One way is to use