Solved

Programming

Posted on 1998-07-16
3
211 Views
Last Modified: 2010-03-30
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?
0
Comment
Question by:AmyS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Author Comment

by:AmyS
ID: 1226870
Edited text of question
0
 

Expert Comment

by:mintt
ID: 1226871
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.
0
 
LVL 16

Accepted Solution

by:
imladris earned 20 total points
ID: 1226872
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;
        return;
    }

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

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question