How to get X and Y index of element inside GridLayout?

后端 未结 5 2207
不知归路
不知归路 2020-11-22 01:12

I am studying a java tutorial and saw that the way to find the x/y indexes of a JButton inside a GridLayout is to traverse a bidimensional array of buttons b which is associ

5条回答
  •  耶瑟儿~
    2020-11-22 01:55

    From JButtons

    • JButton#setName(String);

    • JBUtton#setActionCommand(String);

    • JBUtton#setAction(Action);

    from/to Container

    SwingUtilities#convert...

    SwingUtilities#getDeepestComponentAt

提交回复
热议问题