• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 230
  • Last Modified:


Can I use an image as background in application program ? Can I put TextFields and Buttons on the image?  
If can, how to code this? Could you please give me an example?
1 Solution
AmySAuthor Commented:
Edited text of question
sure you could,
check out on Panel Class
create your application base on Panel Class.
You can place what ever you like on panel.
draw background image in panel class.
Specifically, you should derive a panel of your own from the
Panel class. Then override the paint method to supply whatever
graphics you like. If you want to use show an Image it would be
something along the lines of:

class ImagePanel extends Panel
{   Image background;

    ImagePanel(Image bkg)
    {   background=bkg;

    public void paint(Graphics g)
    {   g.drawImage(background,0,0,this);

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now