Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Swing / AWT / SWT
Setting image size
Klaas Vredevort
Greenhorn
Posts: 29
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hey guys
I have an
Applet
with a width of 500 and a height of 500 as well. i have an Image, jaspershangman.jpg, that I want to load to fit the entire window.
case 3: Toolkit toolkit = Toolkit.getDefaultToolkit (); jasper = toolkit.getImage ("jaspershangman.jpg"); MediaTracker mediaTracker = new MediaTracker (this); mediaTracker.addImage (jasper, 0); try { mediaTracker.waitForID (0); } catch (InterruptedException ie) { System.err.println (ie); System.exit (1); } // Font font1 = new Font ("Arial", Font.BOLD, 66); // setBackground (Color.green); // g.drawString ("Hangman!", 100, 100); // jasper.Width (500); break;
What can I do... I suppose it should be quite straightforward...
Thanks in advance!
Klaas
Keith Lynn
Ranch Hand
Posts: 2412
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
There is a method in Image called getScaledInstance.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
linux server load an image from file
getImage()
haveing trouble with applet animation plz help
Closing a frame
Toolkit.getImage()
More...