Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 12 of 12

Thread: JavaFx jar file does not load icon from its assets

  1. #1
    Junior Member
    Join Date
    Apr 2019
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question JavaFx jar file does not load icon from its assets

    I am running my code using Intelij IDE.The code is running fine but when i convert it into jar it does not load icons from its assets

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    24,110
    Thanks
    53
    Thanked 2,618 Times in 2,568 Posts

    Default Re: JavaFx jar file does not load icon from its assets

    Can you post the code that is trying to load the icons?
    Also post the location and path to the icons.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Apr 2019
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JavaFx jar file does not load icon from its assets

    icons link.PNG

    All the content like css,fonts are placed in assets

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    24,110
    Thanks
    53
    Thanked 2,618 Times in 2,568 Posts

    Default Re: JavaFx jar file does not load icon from its assets

    Can you post the java code that is trying to load the icons? Not an image of the code.
    Also post the location and path to the icons to show where the files are located.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Apr 2019
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JavaFx jar file does not load icon from its assets

    link css.PNG

    Link to css

    Below link to icon class
    icon.PNG

    Here is below my assets screenshot
    Screenshot (87).jpg

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    24,110
    Thanks
    53
    Thanked 2,618 Times in 2,568 Posts

    Default Re: JavaFx jar file does not load icon from its assets

    Please copy and paste text , not images

    Where is the java code that you are working with? I don't recognize the language shown in the images.


    For a path I'd expect something like this:
    D:\Norms\JPF_stuff\IP_Addresses.txt
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Junior Member
    Join Date
    Apr 2019
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JavaFx jar file does not load icon from its assets

    links to css
    <link rel="icon" href="assets/images/logo-icon.png" type="image/x-icon">
    <!-- Bootstrap core CSS-->
    <link href="assets/css/bootstrap.min.css" rel="stylesheet" />
    <!-- animate CSS-->
    <link href="assets/css/animate.css" rel="stylesheet" type="text/css" />
    <!-- Icons CSS-->
    <link href="assets/css/icons.css" rel="stylesheet" type="text/css" />
    <!-- Custom Style-->
    <link href="assets/css/app-style.css" rel="stylesheet" />
    <!-- Notification Style-->
    <link rel="stylesheet" href="assets/plugins/notifications/css/lobibox.min.css">

    Icon linlk

    <i class="icon-user"></i>
    All the files place in assets like css,fonts etc

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    24,110
    Thanks
    53
    Thanked 2,618 Times in 2,568 Posts

    Default Re: JavaFx jar file does not load icon from its assets

    Sorry, I don't know how to use CSS with a java program.
    If you don't understand my answer, don't ignore it, ask a question.

  9. #9
    Junior Member
    Join Date
    Apr 2019
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JavaFx jar file does not load icon from its assets

    There is not java code in which icons are called and implimented.We use only links to call our css,icons and fonts etc.we make classes in css and link them

  10. #10
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    24,110
    Thanks
    53
    Thanked 2,618 Times in 2,568 Posts

    Default Re: JavaFx jar file does not load icon from its assets

    Try this site: https://coderanch.com/f/98/JavaFX
    I think it has more people that know JavaFX
    If you don't understand my answer, don't ignore it, ask a question.

  11. #11
    Junior Member
    Join Date
    Apr 2019
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JavaFx jar file does not load icon from its assets

    ok thanks.
    one more question please
    I am using 2 languages in my project.When i run the project on Intelij and change language it,s working fine.Default language is English and other is Japanese.But when creating Executable jar file and change from English to Japanese .It show special characters instead of converting it into Japanese properly

  12. #12
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    24,110
    Thanks
    53
    Thanked 2,618 Times in 2,568 Posts

    Default Re: JavaFx jar file does not load icon from its assets

    Sorry, I don't have any knowledge about changing languages.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. [SOLVED] Null pointer exception when attempting to load file from inside jar file
    By teslaa in forum What's Wrong With My Code?
    Replies: 2
    Last Post: December 13th, 2018, 06:47 PM
  2. JEditorPane doesn't load html file when jar executable run
    By dancaer69 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: November 12th, 2013, 10:46 AM
  3. image does not load to .jar file after been compile
    By azuma kazuma in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 26th, 2013, 08:34 AM
  4. how to show/open/load JPanel(form) in an external jar
    By iskandar in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: January 16th, 2012, 07:19 AM
  5. [SOLVED] I cant load the icon!!!!
    By chronoz13 in forum AWT / Java Swing
    Replies: 12
    Last Post: January 22nd, 2010, 03:52 AM

Tags for this Thread