Results 1 to 3 of 3
Thread: Jbutton size
- 03-18-2009, 10:22 AM #1
Member
- Join Date
- Mar 2009
- Posts
- 12
- Rep Power
- 0
Jbutton size
hi friends.
I am new to swings. I am using buttons in my panels. I want to resize the button according to my requirement. I used setPreferredSize() but this method only alters buttons width and not height.Can u help me overcome this hurdle.The question may be simple but still i need a precise solution pls
- 03-18-2009, 10:50 AM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
What do you mean "resize the button according to my requirement".
Normally the button is as large as it needs to be to display what it needs to display.
Try, however, changing not only setPreferredSize, but setMinimumSize as well, then, of course, validate and repaint the Panel containing the button.
-
Similar Threads
-
Jbutton not working??
By rmabrey in forum AWT / SwingReplies: 7Last Post: 09-24-2008, 05:30 PM -
Help with JButton
By geoffreybarwise in forum New To JavaReplies: 4Last Post: 05-21-2008, 10:48 AM -
JButton onClick?
By Joe2003 in forum AWT / SwingReplies: 2Last Post: 01-06-2008, 03:04 PM -
Help with JButton and layout
By adlb1300 in forum AWT / SwingReplies: 1Last Post: 12-25-2007, 08:33 AM -
Need help with JButton event
By adlb1300 in forum New To JavaReplies: 2Last Post: 11-19-2007, 01:15 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks