Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 12-07-2005, 11:16 PM   #1 (permalink)
ibexpiotr's Avatar
 
True Techie

Join Date: Nov 2003

Posts: 197

ibexpiotr is on a distinguished road

Send a message via AIM to ibexpiotr
Default java JButtons

is there a way to controll the size of them.
i want them to fit my ImageIcon
ibexpiotr is offline  
Old 12-14-2005, 05:22 PM   #2 (permalink)
 
Newb Techie

Join Date: Oct 2004

Posts: 20

MrMarcDee

Default

The size of components like JButtons are dependant on what the layoutmanager tells them to do. There a a bunch of different rules that the layout manager follows, so unless I knew more about what you were doing I can't be very specific, but I will say this. If you put a single button with an image onto a JFrame and set the JFrame size to say (100,100), then the JButton would fill the whole frame. But if you used JFrame.pack() method then the JButton gets to use all of its preferred sizes and takes the size of the image and then the frame "packs" (automatically sizes) around the button.
MrMarcDee is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On