Link to home
Start Free TrialLog in
Avatar of rickyman35
rickyman35

asked on

add image to JPanel

I dont know much about java but I need this answer fast. Whats the simplest way to add a picture to java?

public class pff extends JPanel
{

public void paint(Graphics g)
{
      g.setColor(Color.BLUE);
      g.fillOval(X, Y, 25, 25);
}

}

I've got something like that, I want to be able to change the oval to a picture on my hard drive, how do I do that?
ASKER CERTIFIED SOLUTION
Avatar of sciuriware
sciuriware

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rickyman35
rickyman35

ASKER

I cant get it to show up, I add it to the paint method but nothing shows up. It lets me compile though.
SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>> I cant get it to show up, I add it to the paint method but nothing shows up.

What layout did you use on the container?
Please split.

;JOOP!
Opps... Sorry I meant to do a split only between CEJH and sciuriware, moderator please correct.

Regards
no problem.