• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

New to JavaFX and struggling  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am new to JavaFX and am just trying to make an MMOrpg wh type program where I can buy and sell items randomly generated by an script
(got the idea from a guy whos doing something similar for DnD and it sounded fun)

problem is I have like no experience in GUI, and its been a real struggle.


I don't know how to really ask anything specific because my guess is i'm lacking some core understanding of how these containers work and padding etc.



CurrentIMG.PNG
[Thumbnail for CurrentIMG.PNG]
Current
 
Steve Datz
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay so apparently there is no Edit button on this forum? I cant find it and my post auto-posted when i UL'd my image. This is quite discouraging

However,
As you can see this Is not looking anything like a good Warehouse.
There are tons of Gaps in between the Containers.

The Center ones called TE and somehow being smushed vertically,
and the left side LE is doing more toward something I want to see.


I dont know what would be most helpful for explaining this, just posting the whole project, or chunks of code.

I think I am having an issue with how this scene is being added to the startmenu and perhaps things are scaling to the parent? Im not sure,
But anyway,
I have a root scene with a BorderPane, I hit the start button,
and a have an actionlistener that sets my stage to set the new scene generated here :
staged.setScene(shopNPC.getScene());



I've tried tons of methods to resize things, set padding, preferd col/rows, alignments but like 90% of them do not work. What Ive managed to read online ab fx is that it somehow doesnt care because of a parent node?

Any help trying to make this look more like this would be greatly appreciated  :
https://assets.rpgsite.net/images/images/000/046/042/original/TW3m_Shop_NEW.png
https://cdnb.artstation.com/p/assets/images/images/012/265/667/large/dan-voinescu-witcher3-2017-01-20-11-13-55-84-1.jpg?1533897620

 
Rancher
Posts: 1170
18
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

've tried tons of methods to resize things, set padding, preferd col/rows, alignments but like 90% of them do not work. What Ive managed to read online ab fx is that it somehow doesnt care because of a parent node?  


That's right, you can change the settings of your childnodes as mutch as you want, if the parrent node has a fixed size, it won't mather.
Start from the top down set all your containers to computed size and only change the width and higt of the element you wan't to change, that way if you change the childs size, the ancestors will automaticly recompute and change too
 
Marshal
Posts: 5987
155
Chrome Eclipse IDE Java Postgres Database Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Steve Datz wrote: Okay so apparently there is no Edit button on this forum? I cant find it and my post auto-posted when i UL'd my image. This is quite discouraging


That can be frustrating.  The edit button was abused by some in the past, so you need to certain level of "experience" before you can edit posts.

Until then, there is a Preview button next to the Submit button.  Use that to make sure your post is correct.

And Welcome to the Ranch!
 
Steve Datz
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the replies,
Any idea how many posts I need before I unlock the edit button?
Life on a forum is going to be messy without it... its like being forced to program without an IDE almost lol.


As far as the editing the parent, I had a feeling this was the case,
but I can't for the life of me figure out like...
what the parent sizes are that are preventing this.

For example,
My Original start menu goes :



Then I call another class to make my shop class


inside the shop class I  make



then s is what is returned.

So.. I am just not understanding what my parent is?
Is it the framebp BorderPane from the shop class ?
because technically thats the top most frame right?
What do I have to do to it to make sure the items inside the center and left etc panes are able to be controlled?
 
Steve Datz
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Steve Datz wrote:

Then I call another class to make my shop class



should say shop scene.  >.<

*no edit button >.< *
 
Knute Snortum
Marshal
Posts: 5987
155
Chrome Eclipse IDE Java Postgres Database Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you setting the width and height on your stage?  Try removing those lines.
 
Steve Datz
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, this has definitely started helping, this is allowing these methods like setprefRows() to work for a TilePane now, so thats good.

However I had set the width and height of the window because I eventually want the program window to probably just be one size, and not resizeable. Un-doing this means my startmenu window is tall and skinny, when I click settings, it becomes a little wider, go back to startmenu, screen resizes again, click start and the window becomes much bigger.

I am trying to avoid that if you know what I am trying to say,
is there another way to do this?
 
Knute Snortum
Marshal
Posts: 5987
155
Chrome Eclipse IDE Java Postgres Database Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know of a way to do this except to control the size and placement of every element.  You may want to use a JavaFX Pane to do this.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!