displaying image in jframe using (x,y) coordinates

A

Ahsan Rabbani

I've searched hours for this but can't seem to find how to do this
anywhere.. Please help me out if anyone knows how I can do this..

If I have the following code, how can I display lets say, "icon.gif"
at (200,300)?

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class RoundTableGUI {

public static void main(String[] args) {
JFrame gui = new JFrame("RoundTableWorld");

gui.setSize(500,500);
gui.setLocation(60,60);
gui.setVisible(true);
gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

}
}

I'd appreciate any help, thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top