Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 976775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:48:02+00:00 2026-05-16T03:48:02+00:00

I made an Applet with some Panels on it. I draw something on a

  • 0

I made an Applet with some Panels on it.
I draw something on a panel with specific methods I created, they use a graphics object to draw.
To draw I use commands like:

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

Then I call these methods from the applet class.
My problem is the following: After I minimize or resize the browser window the panel does not
show anything, I suppose it’s because I didn’t implement anything in the paint() method of the panel.
Is there an way to fix that problem without changing all my methods?

Some of my methods are like that:

//paint a node with coords x,y and nodeNumber in the center of the node
public void paintNode(int x,int y,Integer numberOfNode){

    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);

}

//marks red the processing edge
public void markEdge(int x1,int y1,int x2,int y2,Integer numberOfNode1,Integer numberOfNode2,int weight){

    gr.setColor(Color.red);
    this.paintEdge(x1,y1,x2,y2,numberOfNode1,numberOfNode2,weight);
    this.paintNode(x1, y1, numberOfNode1);
    this.paintNode(x2, y2, numberOfNode2);

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:48:03+00:00Added an answer on May 16, 2026 at 3:48 am

    You need to call update()/repaint() methods on Panel when window is minimized and maximized.

    You will need to override start() method of applet and add repaint() to it.
    Defination for start():

    public void start():
    This is called after the “init” event. It is also called at times when the user is not using your applet and starts to use it again such as when a minimized browser containning your applet is maximized.

    Here is how you code should look:

    public void start(){
        super.start();
        this.repaint();
    }
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made a Java Applet with some Standard GUI Components on it. I used
I have made a Java Applet that depends on some third party libriaries as
Made a custom obj called Item with some string fields and one float. .h
I made some research and it seems that Javascript and MIDI are not going
When I do web development, I use a custom made logger that catches fatal
Apparently, Windows made some major changes to the audio architecture in Windows Vista. As
I made a HTML5 game for web browsers. Some of the players asked me
I'm trying to make to make some text appear before my applet loads so
on their website they have announcements made at various times saying that it is
We've made an application that embeds some web content, which has been approved before.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.