java - Add graphic using a JLabel -


is correct use jlabel when need insert graphic or other way? im using swing.

imageicon icon = new imageicon("icon.png"); jlabel label = new jlabel(icon); panel.add(label); 

http://docs.oracle.com/javase/tutorial/uiswing/components/icon.html

there's more 1 way insert graphic. depends on how want use graphic. if icon simplest , fastest way.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -