aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes buttons are too big Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "buttons are too big" Watch "buttons are too big" New topic
Author

buttons are too big

Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

i am just starting a new project: the GUI part.
the frame is set for the same size as wordpad.
i have a panel that goes in North.
i gave it a flow layout.
it contains 2 JComboBox and 7 buttons.
it looked ok till i added the icons to the buttons.
the buttons are now too big.
can i make them the same size as the icons they display?
can i just make them smaller?
so they fit.

i tried setSize(int, int)
it didn't do anything.


SCJP
Visit my download page
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4664
    
    5

setMargin(...)


luck, db
There are no new questions, but there may be new answers.
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

that is good to know, but not what i did. i used setPreferredSize(Dimension d)

it is exactly what i wanted. i even have room left over for a print button
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4664
    
    5

That won't suffice for any and every layout.

You want a button without margins, the appropriate approach is to set the margins to [0, 0, 0, 0].
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

ok, it works for flow layout though
on rethinking, i think i will do it your way. it's just as easy
easier even
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: buttons are too big