Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2010
    Posts
    72
    Rep Power
    0

    Default set button size in case of layout managers

    hi all
    i am trying to set the size of the button...i am using GridLayout
    i tried button.setSize and button.setPreferredSize but it is not working...what to do????

  2. #2
    curmudgeon is offline Senior Member
    Join Date
    May 2010
    Posts
    436
    Rep Power
    5

    Default

    When you use GridLayout, the layout will force the components to be a certain size. One way to solve this is to place the JButton into a JPanel and then the JPanel into the grid.

  3. #3
    Join Date
    Jan 2010
    Posts
    72
    Rep Power
    0

    Default

    Quote Originally Posted by curmudgeon View Post
    When you use GridLayout, the layout will force the components to be a certain size. One way to solve this is to place the JButton into a JPanel and then the JPanel into the grid.
    thanx sir...:)

  4. #4
    curmudgeon is offline Senior Member
    Join Date
    May 2010
    Posts
    436
    Rep Power
    5

Similar Threads

  1. Why use layout managers in applet?
    By Splat in forum New To Java
    Replies: 2
    Last Post: 10-14-2009, 04:41 AM
  2. Download managers
    By islamfunny in forum CLDC and MIDP
    Replies: 4
    Last Post: 08-15-2008, 01:19 AM
  3. Multiple Layout Managers
    By AJG in forum New To Java
    Replies: 0
    Last Post: 04-06-2008, 01:43 AM
  4. website java button layout
    By abcdefg in forum AWT / Swing
    Replies: 0
    Last Post: 12-25-2007, 04:44 PM
  5. Layout Managers
    By gmioannou in forum AWT / Swing
    Replies: 1
    Last Post: 12-24-2007, 04:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •