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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:54:41+00:00 2026-05-11T10:54:41+00:00

I am currently making a program with the AWT GUI and I’m running into

  • 0

I am currently making a program with the AWT GUI and I’m running into a problem. I basically want an image in the top left hand corner of the screen, and a column of buttons on the right of the image. This isn’t what’s happening though. When I run the applet, I click a popup saying ‘Start Program’ and then the picture I want is in the applet window itself and the column of buttons is in another window by itself. This is what it looks like:

screenshot

Is there anyway to fix this so that the image and the buttons are in the same window?

  • 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. 2026-05-11T10:54:41+00:00Added an answer on May 11, 2026 at 10:54 am

    Yeah. You’re creating a frame but your graphic isn’t inside the frame. Can’t tell much without the code, but the AWT Tutorial at java.sun.com isn’t bad on this stuff.


    Okay, a little more (I haven’t used AWT in a long time.)

    Here’s the couple of issues you have. A Frame is a kind of Window — it wants to be a separate window with its own close button and so forth.

    When you create your graphic, you have to tell it was component its parent is; you’re somehow parenting it to the Applet. So you have some piece of code that looks like

    add(myComponent); 

    in the context of the Applet as this.

    public class myApplet extends Applet {    // lots of stuff here creating your canvas, putting the image in it    // and so forth.  There's an example, see fn 1.    // When you're done, you have a component, call it myImage.     add(myImage); } 

    You have a Frame, and you’re adding your buttons to that.

    public class MyFrame extends Frame {      add(new Button(...));     add(new Button(...));  } 

    You need to move the code that adds your Canvas into the Frame class in some method.

    (WARNING: this is not complete Java code, I don’t recall the names of the right methods offhand. Probably the init() method in the Applet, at least.

    fn1. http://java.sun.com/developer/onlineTraining/awt/contents.html#simpleexample

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

Sidebar

Ask A Question

Stats

  • Questions 97k
  • Answers 97k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Why do you have a <div> inside the <li>? Completely… May 11, 2026 at 7:24 pm
  • Editorial Team
    Editorial Team added an answer Along with compiling code, Visual Build can be used to… May 11, 2026 at 7:24 pm
  • Editorial Team
    Editorial Team added an answer In bowling, strikes and spares are called "marks." Use this!… May 11, 2026 at 7:24 pm

Related Questions

I am currently making a program with the AWT GUI and I'm running into
I am writing a program that will draw a solid along the curve of
We have two columns in a database which is currently of type varchar(16). Thing
I have several different c# worker applications that run various continuous tasks: sending emails
I am working on a program that encodes a file based on a supplied

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.