Retrieve the path of an ImageIcon

前端 未结 2 1823
广开言路
广开言路 2021-01-14 05:22

Is it possible to get the location of the file that an ImageIcon was created from?

Internally ImageIcon has a transient private URL of its location, which when debu

2条回答
  •  甜味超标
    2021-01-14 06:16

    Have you tried getDescription()?

    I only say so because in the documentation for public ImageIcon(String filename) it lists getDescription() under "See Also".

    Note: see Jeffrey's comment.

提交回复
热议问题