• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

GridPane setPadding(); error

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The grid.setPadding method is giving me an error in my program saying that java.awt insets can not be converted to javafx.geometry insets.  I have changed the geometry import to include all of the geometry package by using the .* after geometry but nothing has changed.

I must be missing something.  I am following the Oracle tutorial exactly as it is written but this error persists and causes a compiler error.
 
Rancher
Posts: 383
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Christian,

One thing I have learned about imports is you have to be careful not to presume importing "broad-based" packages covers all classes (using wildcards), specifically the one you need.

Try importing javafx.geometry.Insets specifically instead of javafx.geometry.*, which I presume you were trying to do.

Hope this helps. If it does, credit goes to the responder on this forum

Regards,

Randy
 
Christian Antfeld
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe I have tried that already but I will try it once again later when I get home from work.  If no response, it didn't work.  Thanks for the info though.  I didn't know that wasn't a catch-all for instances like that.
 
Randy Maddocks
Rancher
Posts: 383
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are welcome.

My comment concerning wildcards in import statements aside, without seeing all the import statements you are using, but based on the error you indicated, the compiler is looking for the specific javafx.geometry.Insets package. If you have java.awt.Insets then that is not the one the compiler needs.
 
I'm doing laundry! Look how clean this tiny ad is:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic