Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

gridlayout specify row and col  RSS feed

 
Cathy Song
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Is it possible to add a component to a specific cell using gridlayout?

Thanks,
Cathy.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, they're always laid out successively.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
provided the gridlayout has already been set with components, you could use
panel.add(component,index)

and generally used like this
panel.remove(index);
panel.add(component,index);
validate(); //or just panel.revalidate();
repaint();
 
Cathy Song
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks much!

-Cathy.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!