setLocation problem

From: Scott Vetter (svetter_at_ameritech.net)
Date: 11/26/03


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



Relevant Pages

  • Re: Yahoo Chess
    ... This is the message I get when I try to run it in firefox. ... an old version of the client in your cache. ... Under LAN settings what do you reccomend for checking in the boxes. ... "old" game room applet my java starts and everything goes just fine. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Java problem on i386 7.0-CURRENT-200611
    ... accepting the Sun Community Source License, download the ... I get this problem JAVA will not compile or takes all my resources I am out ... your bootstrap JDK is version ... Bootstrap Settings: ...
    (freebsd-current)
  • RE: not reconizing plug ins
    ... may appear due to various security settings in your browser. ... you need to adjust you security settings. ... How to reset your security settings in Internet Explorer: ... Java and installed the new one, when I click on a game to play the Java icon ...
    (microsoft.public.windowsxp.basics)
  • Re: Java Question
    ... Internet files. ... Java Permission, checked for "High Safety" ... to check my settings on ie against the link you gave me, ... message that I need to download and install Macromedia Flash Player (which I ...
    (microsoft.public.windowsxp.general)
  • Re: Java Help!
    ... Try setting the web site for Direct Access instead. ... Click on Client Configuration. ... looking for a specific version of the Java software. ... We have not changed any settings in ISa or on the clients. ...
    (microsoft.public.isaserver)