Solved

Programming

Posted on 1998-07-16
3
197 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
web services creation SOAP vs REST 5 41
object oriented programming comparison 5 72
servlet example issue 6 40
Error in @AspectJ Based AOP with Spring 2 13
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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 theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

777 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