• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

GridBagLaout

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

I have a JLabel on which I have setted a ImageIcon "a.jpg".
Can I apply GridbagLayout on JLabel or ImageIcon.


I want to change a portion of that Imageicon with another image "b.jpg".
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Would it not be easier to create a third icon file c.jpg which is made from the a.jpg and b.jpg files and then apply that file to the JLabel ?
I have never tried appling a GridBagLayout to JLabel but JLabel does inherit the setLayout method from java.awt.Container, so in theory it is possible.
 
reply
    Bookmark Topic Watch Topic
  • New Topic