Win a copy of Spring in Action (5th edition) this week in the Spring forum!

Arek Wróbel

Ranch Hand
+ Follow
since Aug 02, 2017
Cows and Likes
Cows
Total received
-2
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
4
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Arek Wróbel

John Damien Smith wrote:> How do i change this to work outside events because i need to use there event to getSource ?

Can you provide an example of where you would like to do this outside the context of the event?
Perhaps a description of the use-case or a code snippet or mcve (https://stackoverflow.com/help/mcve) with a comment in it, "// how do I change scene here...".


Because to let this code work I need to use some kind of event example:

But I want to put this code:

In initialize() method. But it won't work because there is no variable like event in there.  - >>

So how do i can change this code to work outside Event handlers?
8 months ago
Hello, I found that code at Youtube which allows you to change window by clicking button.
How do i edit this to works without event , ex. at public void initialize(URL url, ResourceBundle rb) {}


So this is the code.

How do i change this to work outside events because i need to use there event to getSource ?
8 months ago
Thanks Carey Brown. Works like i wanted to.
8 months ago

Carey Brown wrote:That should do the trick. You already have the ability to get '<title>: <mark>' from the toString() method.

You've really got to come up with more meaningful names for your classes. 'ObjectOfArray' means nothing whereas 'Game' does.


Yeah, sorry, i know that's bad but  i just make those class for learning purposes and didn't care for naming. I know that is a bad habit . Thank you for you help.
8 months ago

Carey Brown wrote:It looks like you want a print out of a List<ObjectOfArray> (ie 'Game') so that you get:
Is this correct?


Yes my friend : )
8 months ago

Carey Brown wrote:Sounds like you have a runner and that runner has a List<Game> and that Game has multiple fields that you'd like to present as columns in a printout. Could you please show us more code that shows what type 'runner' is and what its class ('Runner'?) looks like? And what your 'Game' class looks like? We're lacking enough info to help you properly.



Game class:




Runner class:

8 months ago

Arek Wróbel wrote:Hey, i want to print my Array in text field like that:
element1 : element2
element1 : element2
I am using getter to get an ArrayList value and toString to print it, but i can't print it, i dont know where to put [i] and [j].

Code for print:



Code for getter:




I am using tutorial from there:   https://www.wikihow.com/Print-an-Array-in-Java
Check for method 3 to fully understand me.




runner.getGamesList()[i] [j].toString(); doesn't seems to work. How to type it?
8 months ago
I know what to do but i can't attach argument row and column to getter.
8 months ago