java - Problem with Applet when the browser window got minimzed or resized -


I have created an applet with some panels on it. I draw something on a panel with some special methods, they use a graphics object to attract. To attract, I use the command like this:

  gr = this.getGraphics; Gr.drawString ... etc  

Then I call these methods from applet class.
My problem is: I do not panels after reducing or resizing the browser window
Show anything, I think this is because I used the paint () of the panel The method did not apply anything.
Is there any way to fix that problem without changing my methods?

Some of my methods are as follows:

  // nodes with public null public node (int x, integer number, integer number of nodes with x, y and node number ) {Gr = this.getGraphics (); Gr.setColor (ShowGUI.getPanelColor ()); Gr.fillOval (X, Y, 40, 40); Gr.setColor (Color.BLACK); Gr.drawOval (X, Y, 40, 40); Gr.drawString (numberOfNode.toString (), x + 17 y + 25); } // Issue processing: Public zero mark agg at edge (int x1, int y1, int x2, int y2, integer numberofonod 1, integer number of node 2, int weight) {gr.setColor (Color.red); This.paintEdge (x1, y1, x2, y2, numberOfNode1, numberOfNode2, weight); This Pantnode (x1, y1, number of node 1); This.paintNode (x2, y2, number of node 2); }  

You can call () / republish () methods on the panel When the window has been minimized and maximized.

This is called after the "init" event, it is also called when the user is not using your applet and starts using it again as if minimized on your applet The browser is maximized.

Here's how to see the code:

  Public Zero Starter () {super.start (); This.repaint (); }  

Hope this helps.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -