Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By DarrylBurke

Thread: How set JButton icon Relative to the JButton size???

  1. #1
    farshad's Avatar
    farshad is offline Member
    Join Date
    Dec 2011
    Posts
    19
    Rep Power
    0

    Thumbs up How set JButton icon Relative to the JButton size???

    Hi dears
    I have a jbutton and i set a icon for this, but my icon size is bigger than my jbutton
    now I how to set icon size Relative to the jbutton size?
    this is my code ..

    ImageIcon icon=new ImageIcon("myUrl");
    jButtonCheckPersonID.setIcon(icon);

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: How set JButton icon Relative to the JButton size???

    This implied that you are setting the JButton's size, or the size of a container in its hierarchy, something that is rarely necessary in a correctly designed GUI.

    To get better help sooner, post a SSCCE (Short, Self Contained, Correct (Compilable), Example) that demonstrates the problem. Use an image from the net that is easily accessible on this or any reputed site.

    db
    farshad likes this.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Hi how can I get the size of the JButton!! Help!!
    By RichersooN in forum New To Java
    Replies: 6
    Last Post: 04-12-2012, 04:19 AM
  2. Icon wont change on a JButton
    By Bagzli in forum New To Java
    Replies: 9
    Last Post: 05-15-2011, 10:48 PM
  3. JButton with Icon & text alignment issue
    By ShardaD in forum AWT / Swing
    Replies: 4
    Last Post: 01-11-2011, 11:10 AM
  4. Removing icon from JButton
    By 3RDofApril in forum AWT / Swing
    Replies: 3
    Last Post: 11-04-2010, 02:57 AM
  5. My icon extends my JButton
    By hitmen in forum AWT / Swing
    Replies: 5
    Last Post: 03-06-2009, 07:49 AM

Tags for this Thread

Posting Permissions

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