pradeep_p43
May 28th, 2002, 02:35 AM
There are several JLabels in a JPanel having GridBagLayout.
A new JLabel is added to the JPanel, when the existing JLabel in the left JPanel is dragged and dropped in the right Jpanel.And accordingly i am increasing the i value for the JLabel, which are created as an array of JLabels.Now after getting (say 12) number of JLabels in the right JPanel, i just wanted to change the layout of the present JLabels.
My problem is... how can i figure out which particular JLabel is the source of an event ? i.e. how can i get the value of i( i.e. the index of JLabel arrays), on which the particular event has been fired...
please make it fast.....
as i am stuck with this...
N.B. i know that i have to use e.getSource()...but my problem is to get the particular JLabel( i.e. the value of i)...
it will be nice if u can write with code...
pradeep
A new JLabel is added to the JPanel, when the existing JLabel in the left JPanel is dragged and dropped in the right Jpanel.And accordingly i am increasing the i value for the JLabel, which are created as an array of JLabels.Now after getting (say 12) number of JLabels in the right JPanel, i just wanted to change the layout of the present JLabels.
My problem is... how can i figure out which particular JLabel is the source of an event ? i.e. how can i get the value of i( i.e. the index of JLabel arrays), on which the particular event has been fired...
please make it fast.....
as i am stuck with this...
N.B. i know that i have to use e.getSource()...but my problem is to get the particular JLabel( i.e. the value of i)...
it will be nice if u can write with code...
pradeep