1. Put image as
Icon / ImageIcon to the JLabel then- If
PreferedSizeis lower thanMaximumSizesize then callJFrame#pack() - otherwise have to call
setSize()
2.Put image as
Icon / ImageIcon by using Custom Painting to theJComponent, JPanel, JLabel e.i. then- then this
JComponent must to returnsPreferredSizea) callJFrame#pack()ifPreferedSizeis lower thanMaximumSize,b) otherwise have to callJFrame#setSize()c) by assume that you don't useImage#getScalledInstance
3.Use
Icon in the JLabel, there is only one issue that image can be smaller then expected size on the screen, but no issue with that, is pretty possible to centering image to the JLabel.CENTERto the JLabel
No comments:
Post a Comment