0

How do i set different color for different row in GridBagLayout?

P.S : I cannot use swing in my app as client requirement.

user966682
  • 111
  • 5
  • 14
  • http://stackoverflow.com/questions/3695402/gridbaglayout-equally-distributed-cells http://stackoverflow.com/questions/7509781/java-gridbaglayout-automated-construction – Samir Mangroliya Sep 27 '11 at 10:35
  • 2
    *"I cannot use swing in my app as client requirement."* Those dang timelords and their fussiness. What, are they off to 1998? ;) – Andrew Thompson Sep 27 '11 at 10:43
  • @Andrew Thompson not, some schools still have a 'curriculum' in Java AWT – mKorbel Sep 27 '11 at 10:49

2 Answers2

1

for AWT works setBackground(Color) too

mKorbel
  • 109,525
  • 20
  • 134
  • 319
1

A GridBagLayout has nothing to do with the color of any row or component added to a panel that uses a GridBadLayout as the layout manager. If you want different color rows, then you need to create a separate panel for every row of components and set the background color of the panel.

camickr
  • 321,443
  • 19
  • 166
  • 288