JavaSwing graphical interface programming (Part 3)

Display pictures inside JavaSwing window (Chapter III)

Setting up the basic framework (leader packet and do not forget the Jframe inheritance)

And then the resulting container labels

 

 

Use Icon to get the image path

 

 

Placed in the tag after the tag into the container

l.setIcon (icon); // put labels

c.add (l); // put in a container

 

 Finally, look at the effect

 

 We will talk about the next chapter button to trigger the event

Well, this chapter will be over! thank you all!

QQ:3207950853

QQ-mail: [email protected]

Learning exchange group: 710 023 821

 

Guess you like

Origin www.cnblogs.com/yjhjys/p/12661601.html