Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to show/resize picture in swing?

807601Mar 14 2008 — edited Mar 14 2008
I am trying to make simple application that can show a picture in jFrame. That was simple, as I just used icon property of label control. I put it into Scroll Pane and now I can easily view my picture and scroll it - obviously.
Now I want to scale my picture to fit into the panel the Scroll Pane is in, so the scrolls dissapear and I can see whole picture, just scaled down.
Furthermore I want to scale my, let's say 200x200px picture to 100x100px size.
I previously used C# to code and it was easy to do with PictureBox control, now I just want to do the same thing in java, the easier way the better.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 11 2008
Added on Mar 14 2008
6 comments
404 views