This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a custom AWT component that I've written.The component works perfectly---as long as I dont use more than one at a time.Please could someone advise where I might be going wrong?In the example below only the 3rd 't instance' is rendered.Also, from the logging that I put in I can see that at the time that g.drawImage is called, that the values for x and y do not correspond to the correct object..
The default LayoutManager for Frame is BorderLayout. Calling the one-argument add() method will always place the component in the BorderLayout.CENTER position, replacing any previous component in that location.
To show three components, you could use a FlowLayout -- i.e., include