java - how to access Graphics object outside paintComponent() method -
Looking at these methods within the expanded category:
How do I know about how to access the graphics element from inside DrawLabels () with paintComponent ()? (Many) comments about how to deal with graphics items outside of the (colorful) method I have seen, but I can not find my head around an alternate solution.
Any useful suggestions will be appreciated.
How do I go about drawingCamponent () to access the graphics element from within DrawLabels () ?
You do not attempt to directly access the graphics object.
You can pass
drawLabels () to
paintComponent method and then you draw a graphics object in the Draw Labels () method:
Public Zero ColorCompany (Graphics G) {super.paintComponent (g); G.drawImage (image, 0, 0, empty); G.setColor (Color.BLACK); Draw labels (live, label list); } For public Zero Draw labels (Graphics G, Linkedit & Lt; Labels & gt; Label List) {for (Label: Label List) {// Drosring (L. Gate Content), L.A.T.X , L.G.E. Y ()); }}
Comments
Post a Comment