This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Hi I have a JPanel with about 4 components in it I can get the position of a component using GridBagConstraints. is there anyway I can get the instance of the component using the coordinates? I tried using getComponentAt() but that just returns the whole JPanel. myPanel.getComponentAt(x, y) What I'm trying to do is get the component that is next to the compnenet I have selected.
Try findComponentAt(x,y). I'm vague on how these methods differ, but the "find" version definitely claims to drill down through containers to find the visible component. The "get" version doesn't really specify what it does, although I suppose we could look at the code.