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 6696257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:19:13+00:00 2026-05-26T06:19:13+00:00

I am working on a simple GUI app that just draws some graphics on

  • 0

I am working on a simple GUI app that just draws some graphics on a canvas. The environment is Vista 64. When I run the program, the Windows resize and minimize buttons work, but the close button doesn’t. So I have to press the stop button in Eclipse to kill the program.

But sometimes I forget to press stop, and run the program again. The first instance gets stuck and I can’t get rid of it without closing Eclipse. If I get careless I can end up with several java windows I can’t close. Is there a way to get control of and close the windows? Also, why does the close button not work?

I doubt the code matters in this case but here it is:

import java.awt.*;

public class RobotFace extends Canvas{

/**
 * @param args
 */
public static void main(String[] args) {
    RobotFace c = new RobotFace();
    c.setBackground(Color.white);
    c.setSize(350, 350);

    Frame f = new Frame();
    f.add(c); 
    f.setLayout(new FlowLayout()); 
    f.setSize(350,350);
    f.setVisible(true);
}
public void paint(Graphics g){
    g.setColor(Color.black);
    int width = 150;
    int height = 200;
    g.drawRect((getWidth()-width)/2, (getHeight()-height)/2, width, height);
    g.setColor(Color.gray);
    g.fillRect((getWidth()-width)/2, (getHeight()-height)/2, width, height);
    g.setColor(Color.white);
    g.fillRect((getWidth()-80)/2, (getHeight()+50)/2, 80, 20);
    g.setColor(Color.yellow);
    g.fillOval((getWidth()-105)/2, (getHeight()-100)/2, 30, 30);
        g.fillOval((getWidth()+45)/2, (getHeight()-100)/2, 30, 30);
    }
}
  • 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-26T06:19:13+00:00Added an answer on May 26, 2026 at 6:19 am

    Your Eclipse console for the first application instance should still be available, just not visible. On the Console tab, you can click the toolbar button that looks like a little blue monitor to switch between application instances. To stop the first application instance, you would select that instance using the little blue monitor (it’s called “Display Selected Console”), then click the “Stop” button.

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

Sidebar

Related Questions

I'm working on a simple GUI Python script to do some simple tasks on
I've been working on a gui app that needs to manage external processes. Working
I was working on a simple GUI script yesterday using jdbc in eclipse. When
Working on a simple C program I'm stuck with an if test: int line_number
I am working on a simple chat application using a System.Windows.Forms.WebBrowser Control to display
i am working on a simple web app which has a user model and
I am developing a GUI that has a canvas and a bunch of controls
I'm attempting to build a very simple wxPython GUI that monitors and displays external
I am working with a QT GUI. I am implementing a simple hex edit
I have been working on a simple Java app. I had it compiling and

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.