I just want to set my Jlabels coordinates, how hard can that be???? HELP

hey, basically this is the first time ive ever touched java therefore bear with me. Basically all i want to do is set an images coordinates so its where i want it to be. i want the image to stay there permently.
Please help
import javax.swing.JFrame;
import java.awt.image.BufferedImage;
import javax.swing.Timer;
import javax.swing.ImageIcon;
import java.awt.FlowLayout;
import javax.swing.JLabel;
public class Main
public static void main(String[] args)
JLabel image=new JLabel(new ImageIcon("image.gif"));
frame.add(image);
rame.setVisible(true);

hey, basically this is the first time ive ever
touched java therefore bear with me. Basically all i
want to do is set an images coordinates so its where
i want it to be. i want the image to stay there
permently.Two options.
Option A:
Use a null LayoutManager for your JFrame and explicitly set the bounds of the JLabel:
frame.setLayout(null);
image.setBounds(x,y,w,h);  // x,y,w,h are calculated by you somewhere else
frame.add(image);Option B:
Paint the image on the JFrame directly by overriding its painting code.
Neither option is a good idea. What exactly are you trying to create?

Similar Messages

Maybe you are looking for

  • The attempt to burn a disc  failed.  An unknown error occurred (-51)

    My company just purchased a MacBook Pro to go along with our iMac computer. I spoke with an AppleCare guy who talked me through using Migration Assistant to copy my files from the iMac to the MacBook Pro. After doing this, I am able to use the MacBoo

  • RH_STRUC_GET

    hi, using this function module i want to find the number of pernrs having d-p relationship. then with this FM how can we find pernrs with relation ship D-E-P. how to use P up and down.

  • Hard disk spin-down

    I have installed a second hard drive (500GB Western Digital SATA SE16) in my Mac Pro quad-core. The drive spins down regardless of the power management settings (system preferences) and does so even when I'm actively working, but not directly accessi

  • Major build needs power management options

    hello, i recently acquired a mac pro 2008, 8-core 2.8. with the help of an atto r348 and a a kit from maxupgrades, i put in 6x1.5tb seagate barracudas raid 5, 2x250 es.2 raid 0. i also have 32gb ram from transintl, a evga geforce 285. originally i we

  • Press Backspace key does not refresh the softkeyboard screen

    Hi, I'm finding a very weird issue in Adobe Air 3.7 and 3.8 (haven't tried in older versions). When the user clicks on the textfield and the softkeyboard is displayed the key "backspace" doesn't seem to work, nothing seems to be deleted. But when the