setLocation problem
From: Scott Vetter (svetter_at_ameritech.net)
Date: 11/26/03
- Next message: Marty Gagnon: "How to detect when a component is moved from 1 Panel to another"
- Previous message: Rhino: "Re: Need some help with animation"
- Next in thread: Thomas Weidenfeller: "Re: setLocation problem"
- Reply: Thomas Weidenfeller: "Re: setLocation problem"
- Reply: ak: "Re: setLocation problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 26 Nov 2003 16:03:49 GMT
I'm a newbie to Java and am trying to figure out a small problem
with the setLocation statement in that nomatter what settings I use, it
text always appears at the same location.
The code is such:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class test extends JApplet
{
JLabel text = new JLabel("This is the text");
public void init()
{
Container con = getContentPane();
con.setBackground(Color.yellow);
con.setLayout(new FlowLayout());
text.setLocation(100,250);
con.add(text);
}
}
Any help would be appreciated...
TIA,
Scott
- Next message: Marty Gagnon: "How to detect when a component is moved from 1 Panel to another"
- Previous message: Rhino: "Re: Need some help with animation"
- Next in thread: Thomas Weidenfeller: "Re: setLocation problem"
- Reply: Thomas Weidenfeller: "Re: setLocation problem"
- Reply: ak: "Re: setLocation problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|