🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #1251

How to fit a image into a JButton

#1251
From: Jose Luis
Date: Mon, 01 Mar 2004 08:28
17 lines
1250 bytes
Hi everybody

Perhaps someone konws how to resize an image in order to fit into a Jbutton.

JButton JB=new JButton();
JB.setIcon (Img) // Img has been loaded previously

But, o my good, the image is bigger than JB size, and it is shown only
parcially

I need to zoom in/out the image and transform its size into jbutton
dimensions. Does anybody know how to do this?



Regards
Jose Luis
Technical Details
Message-ID: <4042f419@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,be5f6dace717837b,start
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2004-03-01 00:39:28 PST
From: "Jose Luis" <jherrero@unex.es>
Newsgroups: borland.public.jbuilder.java.swing
Subject: How to fit a  image  into a JButton
Date: Mon, 1 Mar 2004 09:28:17 +0100
Lines: 19
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 158.49.21.90
Message-ID: <4042f419@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1078129689 158.49.21.90 (1 Mar 2004 00:28:09 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail