• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

resize image to adapt to grid pane cells size

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone,
I am here asking for your advice and help with an interface. I am trying to reproduce an interface ( attached image). I have some doubts about the middle part. I don't know how to make the images of the cards resizable and responsive according to the size of the cells of the grid pane. For now, it works by code, but I don't think mixing front and back is a good practice. And my CSS doesn't work.

Here is a snippet of the code of the controller, that  want to change :



Here is the fxml file  :



and finally CSS  :

 
Bartender
Posts: 303
12
IntelliJ IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're not breaking any design rules (at least JavaFX ones) by doing that in code, honestly. Some things in JFX simply aren't supported in CSS, but are possible in code. This is probably one of those things (not saying it is for sure, maybe you'll find a way..). So if that code works, I would say you have a solution right there.

Calling these classes "controllers" may not be the most accurate, from an MVC perspective. But then again I suppose I could argue that either way; especially given how many slightly different takes there are on MVC and its variations...
 
moose poop looks like football shaped elk poop. About the size of this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic